small tray fixes

This commit is contained in:
arcan1s 2014-08-24 13:00:50 +04:00
parent d65ded6072
commit e21b2201ab
2 changed files with 6 additions and 3 deletions

View File

@ -165,6 +165,8 @@ void TrayIcon::updateMenu()
contextMenu[QString("gui")]->setText(QApplication::translate("TrayIcon", "Show"));
else
contextMenu[QString("gui")]->setText(QApplication::translate("TrayIcon", "Hide"));
setContextMenu(menuActions);
}
@ -176,6 +178,7 @@ void TrayIcon::createActions()
contextMenu[QString("title")] = new QAction(QIcon(":icon"), QApplication::translate("TrayIcon", "Status"), this);
menuActions->addAction(contextMenu[QString("title")]);
connect(contextMenu[QString("title")], SIGNAL(triggered(bool)), this, SLOT(showInformationInWindow()));
menuActions->addSeparator();
@ -233,9 +236,7 @@ void TrayIcon::init()
setToolTip(QString("netctl-gui"));
createActions();
setContextMenu(menuActions);
connect(this, SIGNAL(messageClicked()), this, SLOT(showInformationInWindow()));
connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(itemActivated(QSystemTrayIcon::ActivationReason)));
}
@ -254,6 +255,8 @@ void TrayIcon::itemActivated(const QSystemTrayIcon::ActivationReason reason)
mainWindow->showMainWindow();
break;
case QSystemTrayIcon::Context:
// clear menu before update
setContextMenu(0);
updateMenu();
break;
default:

View File

@ -1935,7 +1935,7 @@
</message>
<message>
<source>Restart %1</source>
<translation>Перезапустит %1</translation>
<translation>Перезапустить %1</translation>
</message>
<message>
<source>Disable %1</source>