diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4878f1c..729711b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -660,10 +660,18 @@ void MainWindow::onWalletOpened() {
void MainWindow::onBalanceUpdated(double balance, double unlocked, const QString &balance_str, const QString &unlocked_str) {
qDebug() << Q_FUNC_INFO;
+ bool hide = config()->get(Config::hideBalance).toBool();
+
auto label_str = QString("Balance: %1 XMR").arg(unlocked_str);
if(balance > unlocked)
label_str += QString(" (+%1 XMR unconfirmed)").arg(QString::number(balance - unlocked, 'f'));
+
+ if (hide) {
+ label_str = "Balance: HIDDEN";
+ }
+
m_statusLabelBalance->setText(label_str);
+ m_balanceWidget->setHidden(hide);
}
void MainWindow::onSynchronized() {
diff --git a/src/settings.cpp b/src/settings.cpp
index 1b61554..19c8b77 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -22,6 +22,11 @@ Settings::Settings(QWidget *parent) :
connect(ui->btnCopyToClipboard, &QPushButton::clicked, this, &Settings::copyToClipboard);
connect(ui->checkBox_checkForAppUpdates, &QCheckBox::clicked, this, &Settings::checkboxExternalLinkWarn);
connect(ui->checkBox_externalLink, &QCheckBox::clicked, this, &Settings::checkboxExternalLinkWarn);
+ connect(ui->checkBox_hideBalance, &QCheckBox::toggled, [this](bool toggled){
+ config()->set(Config::hideBalance, toggled);
+ m_ctx->updateBalance();
+ });
+
connect(ui->closeButton, &QDialogButtonBox::accepted, this, &Settings::close);
// nodes
@@ -32,6 +37,7 @@ Settings::Settings(QWidget *parent) :
// setup checkboxes
ui->checkBox_externalLink->setChecked(config()->get(Config::warnOnExternalLink).toBool());
ui->checkBox_checkForAppUpdates->setChecked(config()->get(Config::checkForAppUpdates).toBool());
+ ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
// setup comboboxes
auto settingsHomeWidget = config()->get(Config::homeWidget).toString();
diff --git a/src/settings.ui b/src/settings.ui
index e4c7d02..8efdc80 100644
--- a/src/settings.ui
+++ b/src/settings.ui
@@ -7,7 +7,7 @@
0
0
1019
- 358
+ 396
@@ -196,6 +196,13 @@
+ -
+
+
+ Hide balance
+
+
+
diff --git a/src/utils/config.cpp b/src/utils/config.cpp
index b3939a2..a98bb2b 100644
--- a/src/utils/config.cpp
+++ b/src/utils/config.cpp
@@ -47,6 +47,7 @@ static const QHash configStrings = {
{Config::geometry, {QS("geometry"), {}}},
{Config::windowState, {QS("windowState"), {}}},
{Config::firstRun,{QS("firstRun"), false}},
+ {Config::hideBalance, {QS("hideBalance"), false}}
};
diff --git a/src/utils/config.h b/src/utils/config.h
index 7aaa4ec..759ee30 100644
--- a/src/utils/config.h
+++ b/src/utils/config.h
@@ -44,7 +44,8 @@ public:
showTabXMRig,
geometry,
windowState,
- firstRun
+ firstRun,
+ hideBalance
};
~Config() override;