diff --git a/VERSION b/VERSION index 96c019b..6d1ae1c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=3.0.1 +VERSION=3.0.2 diff --git a/src/mambatray b/src/mambatray index 1427723..d85396b 100755 --- a/src/mambatray +++ b/src/mambatray @@ -9,11 +9,13 @@ import os import gettext import libproxy from PyQt5.QtCore import pyqtSignal -from PyQt5 import QtGui -from PyQt5 import QtWidgets +from PyQt5.QtGui import QIcon +from PyQt5.QtWidgets import QSystemTrayIcon, QApplication, QMenu, QMainWindow, QMessageBox, QWidget from PyQt5 import QtCore -class SystemTrayIcon(QtWidgets.QSystemTrayIcon): +class SystemTrayIcon(QSystemTrayIcon): + + context_menu = None def __init__(self, icon, parent=None): global w, menu, contatore, srpm, lista, NetsrpmsArg, nOre, desktop_session @@ -23,8 +25,8 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon): lista = [] contatore = 0 w = parent - QtWidgets.QSystemTrayIcon.__init__(self, icon, parent) - menu = QtWidgets.QMenu(parent) + QSystemTrayIcon.__init__(self, icon, parent) + menu = QMenu(parent) try: desktop_session = os.path.basename(os.getenv('DESKTOP_SESSION')) @@ -54,14 +56,14 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon): softwareBaseInstallsProcess = QtCore.QProcess(self) dcopServerProcess = QtCore.QProcess(self) - softwareMenu = menu.addMenu(QtGui.QIcon.fromTheme("applications-system"),_("Software")) - softwareManageAction = softwareMenu.addAction(QtGui.QIcon.fromTheme("applications-other"),_("Add/Remove software packages...")) + softwareMenu = menu.addMenu(QIcon.fromTheme("applications-system"),_("Software")) + softwareManageAction = softwareMenu.addAction(QIcon.fromTheme("applications-other"),_("Add/Remove software packages...")) softwareManageAction.triggered.connect(self.softwareManager) - softwareCheckUpgradesAction = softwareMenu.addAction(QtGui.QIcon.fromTheme("system-software-update"),_("Check for updates now...")) + softwareCheckUpgradesAction = softwareMenu.addAction(QIcon.fromTheme("system-software-update"),_("Check for updates now...")) softwareCheckUpgradesAction.triggered.connect(self.softwareCheckUpgrades) - softwareBaseInstallsAction = softwareMenu.addAction(QtGui.QIcon.fromTheme("openmamba"),_("openmamba components...")) + softwareBaseInstallsAction = softwareMenu.addAction(QIcon.fromTheme("openmamba"),_("openmamba components...")) softwareBaseInstallsAction.triggered.connect(self.softwareBaseInstalls) # network menu @@ -71,27 +73,27 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon): networkFirewallConfigureProcess = QtCore.QProcess(self) networkProxyProcess = QtCore.QProcess(self) - networkMenu = menu.addMenu(QtGui.QIcon.fromTheme("preferences-system-network"),_("Network")) - networkFirewallMenu = networkMenu.addMenu(QtGui.QIcon.fromTheme("security-medium"),_("Firewall")) - networkFirewallDisableAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-low"),_("Disable")) + networkMenu = menu.addMenu(QIcon.fromTheme("preferences-system-network"),_("Network")) + networkFirewallMenu = networkMenu.addMenu(QIcon.fromTheme("security-medium"),_("Firewall")) + networkFirewallDisableAction = networkFirewallMenu.addAction(QIcon.fromTheme("security-low"),_("Disable")) networkFirewallDisableAction.triggered.connect(self.networkFirewallDisable) networkFirewallDisableProcess.finished.connect(self.networkFirewallDisableMessage) - networkFirewallEnableAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-high"),_("Enable")) + networkFirewallEnableAction = networkFirewallMenu.addAction(QIcon.fromTheme("security-high"),_("Enable")) networkFirewallEnableAction.triggered.connect(self.networkFirewallEnable) networkFirewallEnableProcess.finished.connect(self.networkFirewallEnableMessage) - networkFirewallConfigureAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-medium"),_("Configure...")) + networkFirewallConfigureAction = networkFirewallMenu.addAction(QIcon.fromTheme("security-medium"),_("Configure...")) networkFirewallConfigureAction.triggered.connect(self.networkFirewallConfigure) - networkProxyAction = networkMenu.addAction(QtGui.QIcon.fromTheme("network-server"),_("Proxy...")) + networkProxyAction = networkMenu.addAction(QIcon.fromTheme("network-server"),_("Proxy...")) networkProxyAction.triggered.connect(self.networkProxy) SRPMUpdateProcess.finished.connect(self.SRPMSCheckUpgrade) # about box aboutAction = menu.addSeparator() - aboutAction = menu.addAction(QtGui.QIcon.fromTheme("help-about"),_("About")) + aboutAction = menu.addAction(QIcon.fromTheme("help-about"),_("About")) aboutAction.triggered.connect(self.about) - self.setContextMenu(menu) + self.context_menu = menu self.setToolTip(_("openmamba control center")) self.activated.connect(self.iconActivated) @@ -115,7 +117,7 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon): break def iconActivated(self, reason): - if reason in (QtWidgets.QSystemTrayIcon.Trigger, QtWidgets.QSystemTrayIcon.DoubleClick): + if reason in (QSystemTrayIcon.Trigger, QSystemTrayIcon.DoubleClick): menu.popup(self.geometry().center()) def about(self): @@ -125,15 +127,15 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon): v = open(path, 'r') version = v.read() a = self.FormattaInfo() - version = "