Fix broken notificator on GNOME

That bug was introduced in #14228.
This commit is contained in:
Hennadii Stepanov 2018-12-19 02:08:07 +02:00
parent f080c65a09
commit c8d9d9093b
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -130,6 +130,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
if (QSystemTrayIcon::isSystemTrayAvailable()) { if (QSystemTrayIcon::isSystemTrayAvailable()) {
createTrayIcon(networkStyle); createTrayIcon(networkStyle);
} }
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
// Create status bar // Create status bar
statusBar(); statusBar();
@ -537,8 +538,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel()); unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel());
OptionsModel* optionsModel = _clientModel->getOptionsModel(); OptionsModel* optionsModel = _clientModel->getOptionsModel();
if(optionsModel) if (optionsModel && trayIcon) {
{
// be aware of the tray icon disable state change reported by the OptionsModel object. // be aware of the tray icon disable state change reported by the OptionsModel object.
connect(optionsModel, &OptionsModel::hideTrayIconChanged, this, &BitcoinGUI::setTrayIconVisible); connect(optionsModel, &OptionsModel::hideTrayIconChanged, this, &BitcoinGUI::setTrayIconVisible);
@ -643,14 +643,10 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)
assert(QSystemTrayIcon::isSystemTrayAvailable()); assert(QSystemTrayIcon::isSystemTrayAvailable());
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
trayIcon = new QSystemTrayIcon(this); trayIcon = new QSystemTrayIcon(networkStyle->getTrayAndWindowIcon(), this);
QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText(); QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText();
trayIcon->setToolTip(toolTip); trayIcon->setToolTip(toolTip);
trayIcon->setIcon(networkStyle->getTrayAndWindowIcon());
trayIcon->hide();
#endif #endif
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
} }
void BitcoinGUI::createTrayIconMenu() void BitcoinGUI::createTrayIconMenu()