From d13b4666ed644a5bc5c0cee5657ad0b801ee5ad6 Mon Sep 17 00:00:00 2001 From: stack Date: Sun, 8 Jul 2012 18:54:38 +0200 Subject: [PATCH] Moved addProfile action in createActions in gui it is best to build all "static" actions on init, using the method createActions, and attach them where needed --- gui.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gui.py b/gui.py index 5f16273..17a4e14 100755 --- a/gui.py +++ b/gui.py @@ -89,6 +89,10 @@ class Gui(QtGui.QDialog): self.quitAction = QtGui.QAction("&Quit", self, triggered=QtGui.qApp.quit) + #profile manager component + self.addProfile = QtGui.QAction(" Add &Profile ", self, + triggered=self.addProfile, icon=QtGui.QIcon(appconf.icon)) + def createTrayIcon(self): """ Builds a new tray icon with a context menu and an action for the profile manager menu """ @@ -130,12 +134,9 @@ class Gui(QtGui.QDialog): self.menuProfiles.addAction(menuItem_Profile) - #menuItem_Profile = self.menuProfiles.addAction("") - #self.menuProfiles.addAction(menuItem_Profile) self.menuProfiles.addSeparator() - menuItem_Profile = QtGui.QAction(" Add &Profile ", self, - triggered=self.addProfile, icon=QtGui.QIcon(appconf.icon)) - self.menuProfiles.addAction(menuItem_Profile) + #action and menu item for adding a New Profile + self.menuProfiles.addAction(self.addProfile) self.menuProfiles.activateWindow() self.menuProfiles.popup(QtGui.QCursor.pos()) -- 2.20.1