@@ -130,6 +130,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
130
130
if (QSystemTrayIcon::isSystemTrayAvailable ()) {
131
131
createTrayIcon (networkStyle);
132
132
}
133
+ notificator = new Notificator (QApplication::applicationName (), trayIcon, this );
133
134
134
135
// Create status bar
135
136
statusBar ();
@@ -537,8 +538,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
537
538
unitDisplayControl->setOptionsModel (_clientModel->getOptionsModel ());
538
539
539
540
OptionsModel* optionsModel = _clientModel->getOptionsModel ();
540
- if (optionsModel)
541
- {
541
+ if (optionsModel && trayIcon) {
542
542
// be aware of the tray icon disable state change reported by the OptionsModel object.
543
543
connect (optionsModel, &OptionsModel::hideTrayIconChanged, this , &BitcoinGUI::setTrayIconVisible);
544
544
@@ -643,14 +643,10 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)
643
643
assert (QSystemTrayIcon::isSystemTrayAvailable ());
644
644
645
645
#ifndef Q_OS_MAC
646
- trayIcon = new QSystemTrayIcon (this );
646
+ trayIcon = new QSystemTrayIcon (networkStyle-> getTrayAndWindowIcon (), this );
647
647
QString toolTip = tr (" %1 client" ).arg (tr (PACKAGE_NAME)) + " " + networkStyle->getTitleAddText ();
648
648
trayIcon->setToolTip (toolTip);
649
- trayIcon->setIcon (networkStyle->getTrayAndWindowIcon ());
650
- trayIcon->hide ();
651
649
#endif
652
-
653
- notificator = new Notificator (QApplication::applicationName (), trayIcon, this );
654
650
}
655
651
656
652
void BitcoinGUI::createTrayIconMenu ()
0 commit comments