aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2020-12-15 09:28:39 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2020-12-15 09:28:50 +0100
commit33d6337269224a44585aec1a97a7c1e7d9d9005e (patch)
tree89d376cebb206df3234147e0f3743f022b6ed2ed /src/qt/optionsmodel.cpp
parent94a9cd25fd17e10b5720b5f72908b08c0f1ed16d (diff)
parent03edb52eee5a87af16161c23bdc6cde91a2e5b8b (diff)
downloadbitcoin-33d6337269224a44585aec1a97a7c1e7d9d9005e.tar.xz
Merge bitcoin-core/gui#115: Replace "Hide tray icon" option with positive "Show tray icon" one
03edb52eee5a87af16161c23bdc6cde91a2e5b8b qt: Remove redundant BitcoinGUI::setTrayIconVisible (Hennadii Stepanov) 17174f8328c44ae84479e8365c122ad8502bd7da gui: Replace "Hide tray icon" option with positive "Show tray icon" one (Hennadii Stepanov) Pull request description: This change makes easier both (1) using this option, and (2) reasoning about the code. ACKs for top commit: jonasschnelli: utACK 03edb52eee5a87af16161c23bdc6cde91a2e5b8b Tree-SHA512: 38e317492210d4fb13302dea383bd1f4f0ae1219d7ff2fdcb78607f15ac61a51969acaadb59b72c3f075b6356ef54368eb46fb49e6e1bd42db6d5804b97e232b
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r--src/qt/optionsmodel.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 1603b12a73..152de6decb 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -54,14 +54,15 @@ void OptionsModel::Init(bool resetSettings)
// These are Qt-only settings:
// Window
- if (!settings.contains("fHideTrayIcon"))
+ if (!settings.contains("fHideTrayIcon")) {
settings.setValue("fHideTrayIcon", false);
- fHideTrayIcon = settings.value("fHideTrayIcon").toBool();
- Q_EMIT hideTrayIconChanged(fHideTrayIcon);
+ }
+ m_show_tray_icon = !settings.value("fHideTrayIcon").toBool();
+ Q_EMIT showTrayIconChanged(m_show_tray_icon);
if (!settings.contains("fMinimizeToTray"))
settings.setValue("fMinimizeToTray", false);
- fMinimizeToTray = settings.value("fMinimizeToTray").toBool() && !fHideTrayIcon;
+ fMinimizeToTray = settings.value("fMinimizeToTray").toBool() && m_show_tray_icon;
if (!settings.contains("fMinimizeOnClose"))
settings.setValue("fMinimizeOnClose", false);
@@ -272,8 +273,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
{
case StartAtStartup:
return GUIUtil::GetStartOnSystemStartup();
- case HideTrayIcon:
- return fHideTrayIcon;
+ case ShowTrayIcon:
+ return m_show_tray_icon;
case MinimizeToTray:
return fMinimizeToTray;
case MapPortUPnP:
@@ -342,10 +343,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case StartAtStartup:
successful = GUIUtil::SetStartOnSystemStartup(value.toBool());
break;
- case HideTrayIcon:
- fHideTrayIcon = value.toBool();
- settings.setValue("fHideTrayIcon", fHideTrayIcon);
- Q_EMIT hideTrayIconChanged(fHideTrayIcon);
+ case ShowTrayIcon:
+ m_show_tray_icon = value.toBool();
+ settings.setValue("fHideTrayIcon", !m_show_tray_icon);
+ Q_EMIT showTrayIconChanged(m_show_tray_icon);
break;
case MinimizeToTray:
fMinimizeToTray = value.toBool();