aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qt/bitcoingui.cpp2
-rw-r--r--src/qt/optionsmodel.cpp8
-rw-r--r--src/qt/optionsmodel.h2
-rw-r--r--src/qt/overviewpage.cpp1
4 files changed, 13 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 928d0bd355..c025d4e3aa 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -647,6 +647,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
// initialize the disable state of the tray icon with the current value in the model.
trayIcon->setVisible(optionsModel->getShowTrayIcon());
}
+
+ m_mask_values_action->setChecked(_clientModel->getOptionsModel()->getOption(OptionsModel::OptionID::MaskValues).toBool());
} else {
if(trayIconMenu)
{
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 00b7952ca4..761351468e 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -227,6 +227,8 @@ bool OptionsModel::Init(bilingual_str& error)
m_use_embedded_monospaced_font = settings.value("UseEmbeddedMonospacedFont").toBool();
Q_EMIT useEmbeddedMonospacedFontChanged(m_use_embedded_monospaced_font);
+ m_mask_values = settings.value("mask_values", false).toBool();
+
return true;
}
@@ -435,6 +437,8 @@ QVariant OptionsModel::getOption(OptionID option) const
return SettingToBool(setting(), DEFAULT_LISTEN);
case Server:
return SettingToBool(setting(), false);
+ case MaskValues:
+ return m_mask_values;
default:
return QVariant();
}
@@ -612,6 +616,10 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value)
setRestartRequired(true);
}
break;
+ case MaskValues:
+ m_mask_values = value.toBool();
+ settings.setValue("mask_values", m_mask_values);
+ break;
default:
break;
}
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index e36fbc5b31..848966574d 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -72,6 +72,7 @@ public:
Listen, // bool
Server, // bool
EnablePSBTControls, // bool
+ MaskValues, // bool
OptionIDRowCount,
};
@@ -120,6 +121,7 @@ private:
bool fCoinControlFeatures;
bool m_sub_fee_from_amount;
bool m_enable_psbt_controls;
+ bool m_mask_values;
//! In-memory settings for display. These are stored persistently by the
//! bitcoin node but it's also nice to store them in memory to prevent them
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index 3cd5f4061c..0f00d167f7 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -173,6 +173,7 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
void OverviewPage::setPrivacy(bool privacy)
{
m_privacy = privacy;
+ clientModel->getOptionsModel()->setOption(OptionsModel::OptionID::MaskValues, privacy);
const auto& balances = walletModel->getCachedBalance();
if (balances.balance != -1) {
setBalance(balances);