mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
small tray fixes
This commit is contained in:
parent
d65ded6072
commit
e21b2201ab
@ -165,6 +165,8 @@ void TrayIcon::updateMenu()
|
|||||||
contextMenu[QString("gui")]->setText(QApplication::translate("TrayIcon", "Show"));
|
contextMenu[QString("gui")]->setText(QApplication::translate("TrayIcon", "Show"));
|
||||||
else
|
else
|
||||||
contextMenu[QString("gui")]->setText(QApplication::translate("TrayIcon", "Hide"));
|
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);
|
contextMenu[QString("title")] = new QAction(QIcon(":icon"), QApplication::translate("TrayIcon", "Status"), this);
|
||||||
menuActions->addAction(contextMenu[QString("title")]);
|
menuActions->addAction(contextMenu[QString("title")]);
|
||||||
|
connect(contextMenu[QString("title")], SIGNAL(triggered(bool)), this, SLOT(showInformationInWindow()));
|
||||||
|
|
||||||
menuActions->addSeparator();
|
menuActions->addSeparator();
|
||||||
|
|
||||||
@ -233,9 +236,7 @@ void TrayIcon::init()
|
|||||||
setToolTip(QString("netctl-gui"));
|
setToolTip(QString("netctl-gui"));
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
setContextMenu(menuActions);
|
|
||||||
|
|
||||||
connect(this, SIGNAL(messageClicked()), this, SLOT(showInformationInWindow()));
|
|
||||||
connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
||||||
this, SLOT(itemActivated(QSystemTrayIcon::ActivationReason)));
|
this, SLOT(itemActivated(QSystemTrayIcon::ActivationReason)));
|
||||||
}
|
}
|
||||||
@ -254,6 +255,8 @@ void TrayIcon::itemActivated(const QSystemTrayIcon::ActivationReason reason)
|
|||||||
mainWindow->showMainWindow();
|
mainWindow->showMainWindow();
|
||||||
break;
|
break;
|
||||||
case QSystemTrayIcon::Context:
|
case QSystemTrayIcon::Context:
|
||||||
|
// clear menu before update
|
||||||
|
setContextMenu(0);
|
||||||
updateMenu();
|
updateMenu();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1935,7 +1935,7 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Restart %1</source>
|
<source>Restart %1</source>
|
||||||
<translation>Перезапустит %1</translation>
|
<translation>Перезапустить %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Disable %1</source>
|
<source>Disable %1</source>
|
||||||
|
Loading…
Reference in New Issue
Block a user