diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 6c0e4d1a58..3ae621a30a 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -51,6 +51,7 @@ void OptionsModel::Init() fConfirmOnClose = settings.value("fConfirmOnClose", false).toBool(); fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool(); fLimitTxnDisplay = settings.value("fLimitTxnDisplay", false).toBool(); + fMaskValues = settings.value("fMaskValues", false).toBool(); limitTxnDate = settings.value("limitTxnDate", QDate()).toDate(); nReserveBalance = settings.value("nReserveBalance").toLongLong(); language = settings.value("language", "").toString(); @@ -133,6 +134,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return QVariant(fCoinControlFeatures); case LimitTxnDisplay: return QVariant(fLimitTxnDisplay); + case MaskValues: + return QVariant(fMaskValues); case LimitTxnDate: return QVariant(limitTxnDate); case DisableUpdateCheck: @@ -268,6 +271,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("fLimitTxnDisplay", fLimitTxnDisplay); emit LimitTxnDisplayChanged(fLimitTxnDisplay); break; + case MaskValues: + fMaskValues = value.toBool(); + settings.setValue("fMaskValues", fMaskValues); + emit MaskValuesChanged(fMaskValues); + break; case LimitTxnDate: limitTxnDate = value.toDate(); settings.setValue("limitTxnDate", limitTxnDate); @@ -347,6 +355,11 @@ bool OptionsModel::getLimitTxnDisplay() return fLimitTxnDisplay; } +bool OptionsModel::getMaskValues() +{ + return fMaskValues; +} + QDate OptionsModel::getLimitTxnDate() { return limitTxnDate; @@ -423,6 +436,11 @@ void OptionsModel::setCurrentStyle(QString theme) setData(QAbstractItemModel::createIndex(WalletStylesheet, 0), theme, Qt::EditRole); } +void OptionsModel::setMaskValues(bool privacy_mode) +{ + setData(QAbstractItemModel::createIndex(MaskValues, 0), privacy_mode, Qt::EditRole); +} + QString OptionsModel::getDataDir() { return dataDir; diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index dc86acee63..f9d94bc834 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -44,6 +44,7 @@ class OptionsModel : public QAbstractListModel StakingEfficiency, // double MinStakeSplitValue, // int ContractChangeToInput, // bool + MaskValues, // bool OptionIDRowCount }; @@ -67,6 +68,7 @@ class OptionsModel : public QAbstractListModel bool getDisplayAddresses(); bool getCoinControlFeatures(); bool getLimitTxnDisplay(); + bool getMaskValues(); QDate getLimitTxnDate(); int64_t getLimitTxnDateTime(); QString getLanguage() { return language; } @@ -75,6 +77,7 @@ class OptionsModel : public QAbstractListModel /* Explicit setters */ void setCurrentStyle(QString theme); + void setMaskValues(bool privacy_mode); void toggleCoinControlFeatures(); private: @@ -89,6 +92,7 @@ class OptionsModel : public QAbstractListModel bool fConfirmOnClose; bool fCoinControlFeatures; bool fLimitTxnDisplay; + bool fMaskValues; QDate limitTxnDate; QString language; QString walletStylesheet; @@ -99,6 +103,7 @@ class OptionsModel : public QAbstractListModel void reserveBalanceChanged(qint64); void coinControlFeaturesChanged(bool); void LimitTxnDisplayChanged(bool); + void MaskValuesChanged(bool); void walletStylesheetChanged(QString); };