Skip to content

Commit 9fde0ba

Browse files
committed
Persist "mask values" in gui
fixes #652
1 parent 68b1425 commit 9fde0ba

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/qt/bitcoingui.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ BitcoinGUI::~BitcoinGUI()
246246

247247
void BitcoinGUI::createActions()
248248
{
249+
QSettings settings;
250+
249251
QActionGroup *tabGroup = new QActionGroup(this);
250252
connect(modalOverlay, &ModalOverlay::triggered, tabGroup, &QActionGroup::setEnabled);
251253

@@ -359,6 +361,7 @@ void BitcoinGUI::createActions()
359361
m_mask_values_action->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_M));
360362
m_mask_values_action->setStatusTip(tr("Mask the values in the Overview tab"));
361363
m_mask_values_action->setCheckable(true);
364+
m_mask_values_action->setChecked(settings.value("privacy").toBool());
362365

363366
connect(quitAction, &QAction::triggered, this, &BitcoinGUI::quitRequested);
364367
connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked);

src/qt/optionsmodel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static const char* SettingName(OptionsModel::OptionID option)
5454
case OptionsModel::ProxyPortTor: return "onion";
5555
case OptionsModel::ProxyUseTor: return "onion";
5656
case OptionsModel::Language: return "lang";
57+
case OptionsModel::Privacy: return "privacy";
5758
default: throw std::logic_error(strprintf("GUI option %i has no corresponding node setting.", option));
5859
}
5960
}
@@ -189,6 +190,10 @@ bool OptionsModel::Init(bilingual_str& error)
189190
}
190191
m_enable_psbt_controls = settings.value("enable_psbt_controls", false).toBool();
191192

193+
if (!settings.contains("privacy")) {
194+
settings.setValue("privacy", false);
195+
}
196+
192197
// These are shared with the core or have a command-line parameter
193198
// and we want command-line parameters to overwrite the GUI settings.
194199
for (OptionID option : {DatabaseCache, ThreadsScriptVerif, SpendZeroConfChange, ExternalSignerPath, MapPortUPnP,

src/qt/optionsmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class OptionsModel : public QAbstractListModel
5151
MapPortUPnP, // bool
5252
MapPortNatpmp, // bool
5353
MinimizeOnClose, // bool
54+
Privacy, // bool
5455
ProxyUse, // bool
5556
ProxyIP, // QString
5657
ProxyPort, // int

src/qt/overviewpage.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <qt/transactiontablemodel.h>
1717
#include <qt/walletmodel.h>
1818

19+
#include <QSettings>
20+
1921
#include <QAbstractItemDelegate>
2022
#include <QApplication>
2123
#include <QDateTime>
@@ -176,6 +178,9 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
176178

177179
void OverviewPage::setPrivacy(bool privacy)
178180
{
181+
QSettings settings;
182+
settings.setValue("privacy", privacy);
183+
179184
m_privacy = privacy;
180185
if (m_balances.balance != -1) {
181186
setBalance(m_balances);

0 commit comments

Comments
 (0)