aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-01-11 23:48:58 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-01-15 16:23:55 +0000
commit8a792611249fdefb31a8c69efd9c5022092e25cf (patch)
treecdcc8c7deeba778faf770498d0ee0f27a7972d63 /src/qt
parentf411c8b35bbbd6ff5b5ec70fc0217ec93f01f186 (diff)
downloadbitcoin-8a792611249fdefb31a8c69efd9c5022092e25cf.tar.xz
gui: Keep network style in BitcoinGUI
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoingui.cpp17
-rw-r--r--src/qt/bitcoingui.h3
2 files changed, 11 insertions, 9 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index a3fe3e2268..4e9b3697ff 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -76,7 +76,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
QMainWindow(parent),
m_node(node),
trayIconMenu{new QMenu()},
- platformStyle(_platformStyle)
+ platformStyle(_platformStyle),
+ m_network_style(networkStyle)
{
QSettings settings;
if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) {
@@ -94,9 +95,9 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
} else {
windowTitle += tr("Node");
}
- windowTitle += " " + networkStyle->getTitleAddText();
- QApplication::setWindowIcon(networkStyle->getTrayAndWindowIcon());
- setWindowIcon(networkStyle->getTrayAndWindowIcon());
+ windowTitle += " " + m_network_style->getTitleAddText();
+ QApplication::setWindowIcon(m_network_style->getTrayAndWindowIcon());
+ setWindowIcon(m_network_style->getTrayAndWindowIcon());
setWindowTitle(windowTitle);
rpcConsole = new RPCConsole(node, _platformStyle, nullptr);
@@ -132,7 +133,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
// Create system tray icon and notification
if (QSystemTrayIcon::isSystemTrayAvailable()) {
- createTrayIcon(networkStyle);
+ createTrayIcon();
}
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
@@ -639,14 +640,14 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
openAction->setEnabled(enabled);
}
-void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)
+void BitcoinGUI::createTrayIcon()
{
assert(QSystemTrayIcon::isSystemTrayAvailable());
#ifndef Q_OS_MAC
if (QSystemTrayIcon::isSystemTrayAvailable()) {
- trayIcon = new QSystemTrayIcon(networkStyle->getTrayAndWindowIcon(), this);
- QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText();
+ trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this);
+ QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + m_network_style->getTitleAddText();
trayIcon->setToolTip(toolTip);
}
#endif
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 20b77a6187..606c6d375c 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -161,6 +161,7 @@ private:
int spinnerFrame = 0;
const PlatformStyle *platformStyle;
+ const NetworkStyle* const m_network_style;
/** Create the main UI actions. */
void createActions();
@@ -169,7 +170,7 @@ private:
/** Create the toolbars */
void createToolBars();
/** Create system tray icon and notification */
- void createTrayIcon(const NetworkStyle *networkStyle);
+ void createTrayIcon();
/** Create system tray menu (or setup the dock menu) */
void createTrayIconMenu();