diff --git a/src/mambatray b/src/mambatray index b503614..2f82baa 100755 --- a/src/mambatray +++ b/src/mambatray @@ -17,6 +17,8 @@ from PyQt5.QtCore import QTimer, QProcess class SystemTrayIcon(QSystemTrayIcon): + menu = None + def __init__(self, icon, parent=None): QSystemTrayIcon.__init__(self, icon, parent) @@ -24,14 +26,14 @@ class SystemTrayIcon(QSystemTrayIcon): nOre = 2 srpm = [ "skype", "flashplugin", "win32codecs", "msttcorefonts", "b43-firmware", - "sun-java7", "sun-java8", "virtualbox-extension-pack", "chromium-pepper-flash", + "sun-java", "virtualbox-extension-pack", "chromium-pepper-flash", "spotify" ] NetsrpmsArg = "-c" lista = [] contatore = 0 w = parent - menu = QMenu(parent) + self.menu = QMenu(parent) try: desktop_session = os.path.basename(os.getenv('DESKTOP_SESSION')) @@ -63,7 +65,7 @@ class SystemTrayIcon(QSystemTrayIcon): softwareBaseInstallsProcess = QProcess(self) dcopServerProcess = QProcess(self) - softwareMenu = menu.addMenu(QIcon.fromTheme("applications-system"),_("Software")) + softwareMenu = self.menu.addMenu(QIcon.fromTheme("applications-system"),_("Software")) softwareManageAction = softwareMenu.addAction(QIcon.fromTheme("applications-other"),_("Add/Remove software packages...")) softwareManageAction.triggered.connect(self.softwareManager) @@ -81,7 +83,7 @@ class SystemTrayIcon(QSystemTrayIcon): networkFirewallConfigureProcess = QProcess(self) networkProxyProcess = QProcess(self) - networkMenu = menu.addMenu(QIcon.fromTheme("preferences-system-network"), + networkMenu = self.menu.addMenu(QIcon.fromTheme("preferences-system-network"), _("Network")) networkFirewallMenu = networkMenu.addMenu(QIcon.fromTheme("security-medium"),_("Firewall")) networkFirewallDisableAction = networkFirewallMenu.addAction(QIcon.fromTheme("security-low"),_("Disable")) @@ -97,13 +99,13 @@ class SystemTrayIcon(QSystemTrayIcon): SRPMUpdateProcess.finished.connect(self.SRPMSCheckUpgrade) # about box - aboutAction = menu.addSeparator() - aboutAction = menu.addAction(QIcon.fromTheme("help-about"),_("About")) + aboutAction = self.menu.addSeparator() + aboutAction = self.menu.addAction(QIcon.fromTheme("help-about"),_("About")) aboutAction.triggered.connect(self.about) self.setToolTip(_("openmamba control center")) self.activated.connect(self.iconActivated) - self.setContextMenu(menu) + self.setContextMenu(self.menu) self.show() # the first time refresh packages cache after 5 minutes @@ -140,7 +142,7 @@ class SystemTrayIcon(QSystemTrayIcon): v.close() else: version = _("Error: Unable to find /etc/openmamba-release") - QMessageBox.about(menu, _("About"), + QMessageBox.about(self.menu, _("About"), "