Optionally (only) hide fiat balance

This commit is contained in:
dsc 2021-05-10 22:12:20 +02:00
parent ac1ed1873a
commit d9d0ac1830
5 changed files with 15 additions and 2 deletions

View file

@ -1396,7 +1396,7 @@ void MainWindow::onUpdateXMRWidget() {
} }
void MainWindow::onUpdateFiatBalanceWidget() { void MainWindow::onUpdateFiatBalanceWidget() {
bool hide = config()->get(Config::hideBalance).toBool(); bool hide = config()->get(Config::hideBalance).toBool() || config()->get(Config::hideFiatBalance).toBool();
m_balanceWidget->setHidden(hide); m_balanceWidget->setHidden(hide);
if(!AppContext::prices->markets.count() || !AppContext::prices->rates.count()) if(!AppContext::prices->markets.count() || !AppContext::prices->rates.count())

View file

@ -21,6 +21,10 @@ Settings::Settings(QWidget *parent) :
connect(ui->btnCopyToClipboard, &QPushButton::clicked, this, &Settings::copyToClipboard); connect(ui->btnCopyToClipboard, &QPushButton::clicked, this, &Settings::copyToClipboard);
connect(ui->checkBox_externalLink, &QCheckBox::clicked, this, &Settings::checkboxExternalLinkWarn); connect(ui->checkBox_externalLink, &QCheckBox::clicked, this, &Settings::checkboxExternalLinkWarn);
connect(ui->checkBox_hideFiatBalance, &QCheckBox::toggled, [this](bool toggled){
config()->set(Config::hideFiatBalance, toggled);
m_ctx->updateBalance();
});
connect(ui->checkBox_hideBalance, &QCheckBox::toggled, [this](bool toggled){ connect(ui->checkBox_hideBalance, &QCheckBox::toggled, [this](bool toggled){
config()->set(Config::hideBalance, toggled); config()->set(Config::hideBalance, toggled);
m_ctx->updateBalance(); m_ctx->updateBalance();

View file

@ -161,7 +161,7 @@
<item row="5" column="0"> <item row="5" column="0">
<widget class="QCheckBox" name="checkBox_hideBalance"> <widget class="QCheckBox" name="checkBox_hideBalance">
<property name="text"> <property name="text">
<string>Hide balance</string> <string>Hide balances</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -191,6 +191,13 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_hideFiatBalance">
<property name="text">
<string>Hide fiat balance</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_node"> <widget class="QWidget" name="tab_node">

View file

@ -46,6 +46,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::windowState, {QS("windowState"), {}}}, {Config::windowState, {QS("windowState"), {}}},
{Config::firstRun,{QS("firstRun"), false}}, {Config::firstRun,{QS("firstRun"), false}},
{Config::hideBalance, {QS("hideBalance"), false}}, {Config::hideBalance, {QS("hideBalance"), false}},
{Config::hideFiatBalance, {QS("hideFiatBalance"), false}},
{Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}}, {Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}},
{Config::showHistorySyncNotice, {QS("showHistorySyncNotice"), true}} {Config::showHistorySyncNotice, {QS("showHistorySyncNotice"), true}}
}; };

View file

@ -48,6 +48,7 @@ public:
windowState, windowState,
firstRun, firstRun,
hideBalance, hideBalance,
hideFiatBalance,
redditFrontend, redditFrontend,
showHistorySyncNotice showHistorySyncNotice
}; };