def initMenus(self): mainmenu = KPopupMenu(self) dbmenu = KPopupMenu(self) self.suitemenu = KPopupMenu(self) #suite_actions = self.suiteActions.values() suite_actions = self.manageTraitsActions.values() main_actions = [ self.manageAptSourcesAction, self.openSuiteManagerAction, self.manageAptKeysAction, #self.identifyMachinesAction, self.quitAction ] actions = ['connect', 'disconnect', 'import', 'export'] dbactions = [self.dbactions[action] for action in actions] menubar = self.menuBar() menubar.insertItem('&Main', mainmenu) menubar.insertItem('&Database', dbmenu) menubar.insertItem('&Suite', self.suitemenu) menubar.insertItem('&Help', self.helpMenu('')) for action in main_actions: action.plug(mainmenu) for action in dbactions: action.plug(dbmenu) for action in suite_actions: action.plug(self.suitemenu)
def initMenus(self): mainmenu = KPopupMenu(self) menubar = self.menuBar() menubar.insertItem('&Main', mainmenu) menubar.insertItem('&Help', self.helpMenu('')) self.newClientAction.plug(mainmenu) self.quitAction.plug(mainmenu)
def initMenus(self): mainMenu = KPopupMenu(self) menus = [mainMenu] self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu('')) self.newProfileAction.plug(mainMenu) self.quitAction.plug(mainMenu)
def initMenus(self): mainMenu = KPopupMenu(self) self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu('')) actions = [self.changeSuiteAction, self.quitAction] for action in actions: action.plug(mainMenu)
def initMenus(self): mainMenu = KPopupMenu(self) actions = self._manage_actions.values() actions += [self.quitAction] self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu('')) for action in actions: action.plug(mainMenu)
def initMenus(self): mainMenu = KPopupMenu(self) menus = [mainMenu] self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu('')) for menu in menus: self.diffAction.plug(menu) self.quitAction.plug(menu)
def initMenus(self): mainMenu = KPopupMenu(self) menus = [mainMenu] self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu('')) actions = [ self.loadAction, self.editAction, self.saveAction, self.quitAction ] for action in actions: action.plug(mainMenu)
def __init__(self, *args): apply(KSystemTray.__init__, (self, ) + args) ''' comarInterface instance ''' self.comarInterface = comarInterface(self.winId()) ''' wirelessInterface instance ''' self.wirelessInterface = wirelessInterface() ''' dcopInterface instance''' self.dcopInterface = dcopInterface(self.wirelessInterface) ''' Add /usr/share/PyWireless to KStandardDirs ''' self.KStandardDirs = KStandardDirs() self.KStandardDirs.addResourceDir('icon', '/usr/share/PyWireless') ''' Create tray icon Loader ''' self.icons = KIconLoader('PyWireless', self.KStandardDirs) ''' Timer event triggered every 3 second Until i found a way to use inotify or libfam ''' self.time = QTimer(self) self.connect(self.time, SIGNAL('timeout()'), self.timeoutSlot) self.time.start(3000) self.connect(app, SIGNAL("shutDown()"), self.slotQuit) ''' Popup Menu ''' connectionsMenu = KPopupMenu(self.contextMenu()) ''' list all connections into Connections menu ''' for entry in self.comarInterface.listConnections(): if self.comarInterface.isActive(entry): id = connectionsMenu.insertItem( QIconSet( self.icons.loadIcon('wireless-online', KIcon.Desktop, 16)), entry) else: id = connectionsMenu.insertItem( QIconSet( self.icons.loadIcon('wireless-offline', KIcon.Desktop, 16)), entry) self.connect(connectionsMenu, SIGNAL("activated(int)"), self.switchConnection) self.contextMenu().insertItem(_('Wireless Connections Profiles'), connectionsMenu) # FIXME: Use net-kga self.contextMenu().insertItem(_('Create New Wireless Connection')) self.show()
def initMenus(self): mainMenu = KPopupMenu(self) actions = [ self.manageFamiliesAction, self.editTemplatesAction, self.quitAction ] self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu('')) for action in actions: action.plug(mainMenu)
def initMenus(self): mainmenu = KPopupMenu(self) actions = [ self._manage_action_objects[name] for name in ManageActionsOrder ] actions.append(self.quitAction) menubar = self.menuBar() menubar.insertItem('&Main', mainmenu) menubar.insertItem('&Help', self.helpMenu('')) for action in actions: action.plug(mainmenu)
def initMenus(self): mainmenu = KPopupMenu(self) menus = [mainmenu] menubar = self.menuBar() menubar.insertItem('&Main', mainmenu) menubar.insertItem('&Help', self.helpMenu('')) self.newTraitAction.plug(mainmenu) self.importTraitAction.plug(mainmenu) self.importTraitAction.setText('Import trait') self.exportTraitAction.plug(mainmenu) self.exportTraitAction.setText('Export trait') self.quitAction.plug(mainmenu)
def initMenus(self): mainmenu = KPopupMenu(self) main_actions = [self.bootstrapMachineAction, self.installMachineAction, self.launchMachineAction, self.backupMachineAction, self.editConfigFileAction, self.quitAction] menubar = self.menuBar() menubar.insertItem('&Main', mainmenu) menubar.insertItem('&Help', self.helpMenu('')) for action in main_actions: action.plug(mainmenu)
def initMenus(self): # make a new menu mainmenu = KPopupMenu(self) # plug import new game actions into the menu self.newGameAction.plug(mainmenu) self.importZipFileAction.plug(mainmenu) # insert a little line separating menu items mainmenu.insertSeparator() # plug launch dosbox actions into the menu self.launchDosboxAction.plug(mainmenu) self.launchDosboxPromptAction.plug(mainmenu) self.launchMainDosboxPromptAction.plug(mainmenu) # insert a little line separating menu items mainmenu.insertSeparator() # plug the rest of the main menu actions self.prepareAllGamesAction.plug(mainmenu) self.cleanAllGamesAction.plug(mainmenu) self.archiveAllGamesAction.plug(mainmenu) self.quitAction.plug(mainmenu) # make a profiles menu profilemenu = KPopupMenu(self) self.manageDosboxProfilesAction.plug(profilemenu) self.setCurrentProfileAction.plug(profilemenu) # make another menu for options viewmenu = KPopupMenu(self) self.flatViewAction.plug(viewmenu) self.treeViewAction.plug(viewmenu) self.nameViewAction.plug(viewmenu) self.titleViewAction.plug(viewmenu) viewmenu.insertSeparator() self.filterAllGamesAction.plug(viewmenu) self.filterAvailableGamesAction.plug(viewmenu) self.filterUnavailableGamesAction.plug(viewmenu) # make a settings menu settingsmenu = KPopupMenu(self) self.configureDosboxPyKDEAction.plug(settingsmenu) # get a pointer to the menubar in the main window # this method will create a menubar if one is not already # available menubar = self.menuBar() # place the menus on the menu bar (in order) menubar.insertItem('&Main', mainmenu) menubar.insertItem('&Profiles', profilemenu) menubar.insertItem('&View', viewmenu) menubar.insertItem('&Settings', settingsmenu) menubar.insertItem('&Help', self.helpMenu(''))
def initMenus(self): mainMenu = KPopupMenu(self) menus = [mainMenu] self.menuBar().insertItem('&Main', mainMenu) self.menuBar().insertItem('&Help', self.helpMenu(''))