From: stack Date: Sun, 8 Jul 2012 16:54:38 +0000 (+0200) Subject: Moved addProfile action in createActions X-Git-Url: https://v.licheni.net/stack/code/dboxswitch.git/commitdiff_plain/d13b4666ed644a5bc5c0cee5657ad0b801ee5ad6 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 --- 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())