Browse Source

Merge pull request 'Optionally (only) hide fiat balance' (#61) from dsc/wowlet:hide-fiat-balance into master

Reviewed-on: #61
pull/65/head
wowario 3 months ago
parent
commit
5c3821007d
  1. 2
      src/mainwindow.cpp
  2. 4
      src/settings.cpp
  3. 9
      src/settings.ui
  4. 1
      src/utils/config.cpp
  5. 1
      src/utils/config.h

2
src/mainwindow.cpp

@ -1398,7 +1398,7 @@ void MainWindow::onUpdateXMRWidget() {
}
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);
if(!AppContext::prices->markets.count() || !AppContext::prices->rates.count())

4
src/settings.cpp

@ -21,6 +21,10 @@ Settings::Settings(QWidget *parent) :
connect(ui->btnCopyToClipboard, &QPushButton::clicked, this, &Settings::copyToClipboard);
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){
config()->set(Config::hideBalance, toggled);
m_ctx->updateBalance();

9
src/settings.ui

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

1
src/utils/config.cpp

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

1
src/utils/config.h

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

Loading…
Cancel
Save