def createActions(self): """ Qt actions """ self.addAction = QtHelper.createAction(self, self.tr("&Add"), self.addStep, icon=QIcon(":/step-add.png"), tip=self.tr('Add a new step')) self.delAction = QtHelper.createAction( self, self.tr("&Delete"), self.deleteAction, icon=QIcon(":/step-del.png"), tip=self.tr('Delete the selected step')) self.delAllAction = QtHelper.createAction( self, self.tr("&Delete All"), self.clearItems, icon=QIcon(":/test-parameter-clear.png"), tip=self.tr('Delete all steps')) # set default actions self.delAction.setEnabled(False) self.delAllAction.setEnabled(False)
def createActions(self): """ Actions defined: * add * del * clear """ self.addAction = QtHelper.createAction(self, "&Add", self.insertItem, icon=QIcon(":/tc-add.png"), tip='Add a new probe') self.delAction = QtHelper.createAction(self, "&Delete", self.removeItem, icon=QIcon(":/tc-del.png"), tip='Delete the selected probe') self.clearAction = QtHelper.createAction( self, "Clear", self.clearItems, icon=QIcon(":/param-delete.png"), tip='Clear all probes') self.defaultActions()
def createActions (self): """ Create qt actions """ self.startHttpAction = QtHelper.createAction(self.parent, "&Read Http", self.startHttp, icon=None, tip = 'Start the http capture') self.startTcpAction = QtHelper.createAction(self.parent, "&Read Tcp", self.startTcp, icon=None, tip = 'Start the tcp capture') self.startUdpAction = QtHelper.createAction(self.parent, "&Read Udp", self.startUdp, icon=None, tip = 'Start the udp capture') self.startGuiAction = QtHelper.createAction(Gui.instance(), "&New Test...", self.startGui, icon=None, tip = 'Start the capture of the desktop') self.restartGuiAction = QtHelper.createAction(Gui.instance(), "&Update Test...", self.restartGui, icon=None, tip = 'Update the current test for the desktop') self.stopGuiAction = QtHelper.createAction(Gui.instance(), "&Stop", self.stopGui, icon=None, tip = 'Stop the capture of the desktop') self.startWebAction = QtHelper.createAction(Gui.instance(), "&New Test...", self.startWeb, icon=None, tip = 'Start the capture of the web interface') self.startMobileAction = QtHelper.createAction(Gui.instance(), "&New Test...", self.startMobile, icon=None, tip = 'Start mobile assistant') self.startBasicAction = QtHelper.createAction(Gui.instance(), "&New Test...", self.startBasic, icon=None, tip = 'Start basic assistant') self.startSysAction = QtHelper.createAction(Gui.instance(), "&New Test...", self.startSys, icon=None, tip = 'Start system assistant')
def createActions(self): """ Qt Actions """ self.saveTxtAction = QtHelper.createAction( self, "&To TXT", self.saveTxt, tip='Save to TXT file', icon=QIcon(":/file-txt.png")) self.saveHtmlAction = QtHelper.createAction(self, "&To HTML", self.saveHtml, tip='Save to HTML file', icon=QIcon(":/web.png")) self.savePdfAction = QtHelper.createAction(self, "&To PDF", self.savePdf, tip='Save to PDF file', icon=QIcon(":/to_pdf.png")) self.saveXmlAction = QtHelper.createAction(self, "&To XML", self.saveXml, tip='Save to XML file', icon=QIcon(":/xml.png")) self.toPrinterAction = QtHelper.createAction( self, "&To Printer", self.savePrinter, tip='Print', icon=QIcon(":/printer.png"))
def createActions(self): """ Create qt actions """ self.clearAction = QtHelper.createAction( self, "Clear all parameters", self.clearItems, icon=QIcon(":/test-parameter-clear.png"), tip='Clear all parameters') self.setDefaultsAction = QtHelper.createAction( self, "Set default adapters and libraries", self.setDefaults, icon=QIcon(":/refresh-test.png"), tip='Set default adapters and libraries') self.writingAction = QtHelper.createAction( self, "Set writing state", self.stateWritingTest, icon=QIcon(":/writing-state.png"), tip='Set writing state') self.executingAction = QtHelper.createAction( self, "Set executing state", self.stateExecutingTest, icon=QIcon(":/state_right.png"), tip='Set executing state') self.defaultActions()
def createActions(self): """ Create qt actions """ self.refreshAction = QtHelper.createAction(self, self.tr("&Refresh"), self.refreshScreen, icon = None ) self.refreshAction.setEnabled(False) self.copyAction = QtHelper.createAction(self, self.tr("&Copy"), self.copyItem, icon = None )
def moreCreateActions(self): """ More creation qt actions """ self.createSamplesAction = QtHelper.createAction(self, "&Generate samples", self.generateSamples, icon = None, tip = 'Generate samples' ) self.setTestsDefaultAction = QtHelper.createAction(self, "&Set default versions", self.setDefaultVersionForAllTests, icon = None, tip = 'Set default version adapters and libraries for all tests' )
def createActions (self): """ Actions defined: * add * del """ self.addAction = QtHelper.createAction(self, self.tr("&Add"), self.addKey, icon = QIcon(":/test-parameter-add.png"), tip = self.tr('Add a new key') ) self.delAction = QtHelper.createAction(self, self.tr("&Delete"), self.delKey, icon = QIcon(":/test-parameter-del.png"), tip = self.tr('Delete the selected key') ) self.delAllAction = QtHelper.createAction(self, self.tr("&Delete All"), self.delKeys, icon = QIcon(":/test-parameter-del.png"), tip = self.tr('Delete the selected key') )
def moreCreateActions(self): """ On more create qt actions """ self.addLibrariesAction = QtHelper.createAction(self, "&Add Libraries", self.addLibraries, icon = QIcon(":/libraries.png"), tip = 'Create a new set of library' ) self.addLibraryAction = QtHelper.createAction(self, "&Add Library", self.addLibrary, icon = QIcon(":/libraries.png"), tip = 'Create new library' ) self.checkLibrariesAction = QtHelper.createAction(self, "&Check", self.checkSyntaxLibraries, icon = QIcon(":/libraries-check.png"), tip = 'Check syntax of all libraries' ) self.setAsDefaultAction = QtHelper.createAction(self, "&Set as Extra", self.setLibraryAsDefault, icon = None, tip = 'Set library as Extra' ) self.setAsGenericAction = QtHelper.createAction(self, "&Set as Generic", self.setLibraryAsGeneric, icon = None, tip = 'Set library as Generic' )
def createActions(self): """ Create qt actions """ self.addAndroidAction = QPushButton(QIcon(":/add_black.png"), '&Add Action', self) self.addAndroidAction.setMinimumHeight(40) self.addAndroidAction.setMaximumWidth(150) self.cancelAndroidAction = QtHelper.createAction(self, "&Cancel", self.cancelStep, icon=None, tip = 'Cancel update') self.cancelAndroidAction.setEnabled(False) self.optionsAction = QtHelper.createAction(self, "&", self.openOptions, icon=QIcon(":/recorder-mobile-small.png"), tip = 'Android options')
def createActions(self): """ Create qt actions """ self.addAction = QPushButton(QIcon(":/add_black.png"), '&Add Action', self) self.addAction.setMinimumHeight(40) self.addAction.setMaximumWidth(200) self.cancelAction = QtHelper.createAction(self, "&Cancel", self.cancelStep, icon=QIcon(":/undo.png"), tip = 'Cancel update') self.cancelAction.setEnabled(False) self.optionsAction = QtHelper.createAction(self, "&", self.openOptions, icon=QIcon(":/recorder-basic-small.png"), tip = 'Framework options')
def createActions (self): """ Qt actions """ self.delAction = QtHelper.createAction(self, self.tr("&Delete"), self.deleteAction, icon = QIcon(":/adapters-del.png"), tip = self.tr('Delete the selected adapter')) self.delAllAction = QtHelper.createAction(self, self.tr("&Delete All"), self.clearItems, icon = QIcon(":/test-parameter-clear.png"), tip = self.tr('Delete all adapters')) # set default actions self.delAction.setEnabled(False) self.delAllAction.setEnabled(False)
def createActions (self): """ Create qt actions """ self.refreshAction = QtHelper.createAction(self, "&Refresh", self.refreshAll, icon = QIcon(":/refresh.png"), tip = 'Refresh local repository content' ) self.addDirAction = QtHelper.createAction(self, "&Add", self.createItem, icon = QIcon(":/folder_add.png"), tip = 'Create new folder' ) self.delFileAction = QtHelper.createAction(self, "&Delete File", self.deleteItem, icon = QIcon(":/delete_file.png"), shortcut=QKeySequence.Delete, tip = 'Delete file' ) self.delDirAction = QtHelper.createAction(self, "&Delete Folder", self.deleteItem, icon = QIcon(":/folder_delete.png"), shortcut=QKeySequence.Delete, tip = 'Delete folder' ) self.renameAction = QtHelper.createAction(self, "&Rename", self.renameItem, icon = QIcon(":/rename.png"), tip = 'Rename' ) self.expandSubtreeAction = QtHelper.createAction(self, "&Expand folder...", self.expandSubFolder, icon = None, tip = 'Expand folder' ) self.expandAllAction = QtHelper.createAction(self, "&Expand All", self.expandAllFolders, icon = None, tip = 'Expand all folders' ) self.collapseAllAction = QtHelper.createAction(self, "&Collapse All", self.collapseAllFolders, icon = None, tip = 'Collapse all folder' ) self.defaultActions()
def moreCreateActions(self): """ On more create qt actions """ self.addAdaptersAction = QtHelper.createAction(self, "&Add Adapters", self.addAdapters, icon = QIcon(":/adapters.png"), tip = 'Create a new set of adapters' ) self.addAdapterAction = QtHelper.createAction(self, "&Add Adapter", self.addAdapter, icon = QIcon(":/adapters.png"), tip = 'Create new adapter' ) self.checkAdaptersAction = QtHelper.createAction(self, "&Check", self.checkSyntaxAdapters, icon = QIcon(":/adapters-check.png"), tip = 'Check syntax of all adapters' ) self.setAsDefaultAction = QtHelper.createAction(self, "&Set as Extra", self.setAdapterAsDefault, icon = None, tip = 'Set adapter as Extra' ) self.setAsGenericAction = QtHelper.createAction(self, "&Set as Generic", self.setAdapterAsGeneric, icon = None, tip = 'Set adapter as Generic' )
def createActions(self): """ Create qt actions """ self.zoomInAct = QtHelper.createAction(self, "&Zoom &In (25%.", self.zoomIn, icon=QIcon(":/zoom-in.png")) self.zoomOutAct = QtHelper.createAction(self, "Zoom &Out (25%.", self.zoomOut, icon=QIcon(":/zoom-out.png")) self.normalSizeAct = QtHelper.createAction( self, "&Normal Size", self.normalSize, icon=QIcon(":/zoom-normal.png"))
def createActions(self): """ Create actions """ self.toTestUnitAction = QtHelper.createAction(self, self.tr("&Convert\nTest Unit"), self.toTestUnit, icon = QIcon(":/tux.png") )
def createActions (self): """ Create qt actions """ self.openAction = QtHelper.createAction(self, "&Open", self.importTrace, icon=QIcon(":/folder_add.png"), tip = 'Open network trace.') self.exportTUAction = QtHelper.createAction(self, "&Test Unit", self.exportToTU, icon=QIcon(":/%s.png" % WWorkspace.TestUnit.TYPE), tip = 'Export to Test Unit') self.exportTSAction = QtHelper.createAction(self, "&Test Suite", self.exportToTS, icon=QIcon(":/%s.png" % WWorkspace.TestSuite.TYPE), tip = 'Export to Test Suite') self.cancelAction = QtHelper.createAction(self, "&Cancel", self.reject, tip = 'Cancel') menu = QMenu(self) menu.addAction( self.exportTUAction ) menu.addAction( self.exportTSAction ) self.exportToAction = QtHelper.createAction(self, "&Export to", self.exportToTU, icon=QIcon(":/%s.png" % WWorkspace.TestUnit.TYPE), tip = 'Export to tests' ) self.exportToAction.setMenu(menu) self.exportToAction.setEnabled(False)
def createActions(self): """ Create qt actions """ self.resetAction = QtHelper.createAction( self, "&Reset Statistics", self.resetStats, tip='Reset all statistics', icon=QIcon(":/reset-counter.png"))
def createActions(self): """ Create qt actions """ self.loadWebPageAction = QtHelper.createAction( self, "&Go to...", self.onChangeWebLocation, icon=QIcon(":/act-half-refresh.png"), tip='Load Webpage')
def createActions (self): """ Actions defined: * stop an agent * start an agent * delete an agent * clear all fields * refresh running agents * refresh default agents """ self.stopAction = QtHelper.createAction(self, "&Stop", self.stopAgent, tip = 'Stop agent', icon = QIcon(":/act-stop.png")) self.startAction = QtHelper.createAction(self, "&Add / Start", self.startAgent, tip = 'Add default agent', icon = QIcon(":/probe-add.png")) self.delAgentAction = QtHelper.createAction(self, "&Delete", self.delAgent, tip = 'Delete default agent', icon = QIcon(":/probe-del.png")) self.cancelAction = QtHelper.createAction(self, "&Clear", self.resetAgent, tip = 'Clear fields', icon = QIcon(":/clear.png") ) self.refreshRunningAction = QtHelper.createAction(self, "&Refresh", self.refreshRunningAgent, tip = 'Refresh running agents', icon = QIcon(":/act-refresh.png") ) self.refreshDefaultAction = QtHelper.createAction(self, "&Refresh", self.refreshDefaultAgent, tip = 'Refresh default agents', icon = QIcon(":/act-refresh.png") )
def createActions(self): """ Create qt actions """ self.addCommentAction = QtHelper.createAction( self, "&Add", self.addComment, tip='Add comment', icon=QIcon(":/add_post.png")) self.clearAction = QtHelper.createAction(self, "&Clear", self.clearText, tip='Clear fields', icon=QIcon(":/clear.png")) self.delCommentsAction = QtHelper.createAction( self, "&Delete all", self.delComments, tip='Delete all comments', icon=QIcon(":/del-posts.png")) self.setDefaultActionsValues()
def createActions(self): """ Create qt actions """ self.hideDeveloperModeAction = QtHelper.createAction( self, self.tr("Developer"), self.hideDeveloperMode, checkable=True, icon=QIcon(":/window-fit.png"), shortcut=Settings.instance().readValue( key='KeyboardShorcuts/developer'), tip=self.tr('Fit the document viewer to maximize the editor area')) WDocumentViewer.instance().addActionToolbar( action=self.hideDeveloperModeAction)
def createActions(self): """ Actions defined: * add * del * copy * paste * clear """ self.addAction = QtHelper.createAction(self, self.tr("&Add"), self.addAgent, icon=QIcon(":/tc-add.png"), tip='Add a new agent') self.delAction = QtHelper.createAction(self, self.tr("&Delete"), self.removeItem, icon=QIcon(":/tc-del.png"), tip='Delete the selected agent') self.copyAction = QtHelper.createAction(self, self.tr("Copy"), self.copyItem, icon=QIcon(":/param-copy.png"), tip='Copy the selected agent', shortcut='Ctrl+C') self.pasteAction = QtHelper.createAction( self, self.tr("Paste"), self.pasteItem, icon=QIcon(":/param-paste.png"), tip='Paste agent', shortcut='Ctrl+V') self.undoPasteAction = QtHelper.createAction( self, self.tr("Undo"), self.undoPasteItem, icon=QIcon(":/test-parameter-undo.png"), tip=self.tr('Undo paste agent')) self.clearAction = QtHelper.createAction( self, self.tr("Clear"), self.clearItems, icon=QIcon(":/param-delete.png"), tip='Clear all agents') # then disable all self.defaultActions()
def createActions (self): """ Actions defined: * import * export """ self.importAction = QtHelper.createAction(self, "&Import inputs", self.importInputs, icon = QIcon(":/tc-import.png"), tip = 'Import inputs from Test Config' ) self.exportAction = QtHelper.createAction(self, "&Export inputs", self.exportInputs, icon = QIcon(":/tc-export.png"), tip = 'Export inputs as Test Config' ) self.importOutputsAction = QtHelper.createAction(self, "&Import outputs", self.importOutputs, icon = QIcon(":/tc-import.png"), tip = 'Import outputs from Test Config' ) self.exportOutputsAction = QtHelper.createAction(self, "&Export outputs", self.exportOutputs, icon = QIcon(":/tc-export.png"), tip = 'Export outputs as Test Config' ) self.markUnusedAction = QtHelper.createAction(self, "&Mark unused inputs", self.markUnusedInputs, icon = QIcon(":/input-unused.png"), tip = 'Marks all unused inputs' ) self.markUnusedOutputsAction = QtHelper.createAction(self, "&Mark unused ouputs", self.markUnusedOutputs, icon = QIcon(":/input-unused.png"), tip = 'Marks all unused outputs' )
def createActions(self): """ Actions defined: * stop probe * start probe * delete one probe * clear fields * refresh running probes * refresh default probes """ self.stopAction = QtHelper.createAction(self, "&Stop", self.stopProbe, tip='Stop probe', icon=QIcon(":/act-stop.png")) self.startAction = QtHelper.createAction(self, "&Add / Start", self.startProbe, tip='Add default probe', icon=QIcon(":/probe-add.png")) self.delProbeAction = QtHelper.createAction( self, "&Delete", self.delProbe, tip='Delete default probe', icon=QIcon(":/probe-del.png")) self.cancelAction = QtHelper.createAction(self, "&Clear", self.resetProbe, tip='Clear fields', icon=QIcon(":/clear.png")) self.refreshRunningAction = QtHelper.createAction( self, "&Refresh", self.refreshRunningProbe, tip='Refresh running probes', icon=QIcon(":/act-refresh.png")) self.refreshDefaultAction = QtHelper.createAction( self, "&Refresh", self.refreshDefaultProbe, tip='Refresh default probes', icon=QIcon(":/act-refresh.png"))
def onPopupMenu(self, pos): """ Display menu on right click @param pos: @type pos: """ self.menu = QMenu(self) index = self.currentIndex() indexes = self.selectedIndexes() adapters = self.getHelpAdapters() # adapters adpsMenu = QMenu("Add", self) if adapters is not None: for adp in adapters: adpMenu = QMenu(adp['name'], self) adpsMenu.addMenu(adpMenu) for cls in adp['classes']: # extract __init__ function only fct = None for fct in cls['functions']: if fct['name'] == '__init__': break if fct is not None: argsFct = self.parseDocString(docstring=fct['desc']) argsFct['function'] = "%s::%s" % (adp['name'], cls['name']) argsFct['main-name'] = "%s" % adp['name'] argsFct['sub-name'] = "%s" % cls['name'] if 'default-args' in fct: self.addDefaultValues( defaultValues=fct['default-args'], currentFunction=argsFct) adpMenu.addAction( QtHelper.createAction(self, cls['name'], self.addAdapter, cb_arg=argsFct)) if not indexes: self.delAction.setEnabled(False) self.menu.addAction(self.delAction) self.menu.addSeparator() self.menu.addMenu(adpsMenu) self.menu.addSeparator() else: self.delAction.setEnabled(True) self.menu.addAction(self.delAction) self.menu.addSeparator() self.menu.addMenu(adpsMenu) self.menu.addSeparator() self.menu.popup(self.mapToGlobal(pos))
def onPopupMenu(self, pos): """ Display menu on right click @param pos: @type pos: """ self.menu = QMenu(self) # index = self.currentIndex() # get defaults adapters or extra adapters_default = self.getHelpAdapters() # get generic adapters adapters_generic = self.getHelpAdapters(generic=True) # main menu menu_adps = QMenu("Add Adapters", self) # adapters default menu_adps_generic = QMenu("Generic", self) menu_adps.addMenu(menu_adps_generic) if adapters_generic is not None: for adp in adapters_generic: adp_menu_generic = QMenu(adp['name'], self) menu_adps_generic.addMenu(adp_menu_generic) for cls in adp['classes']: # extract __init__ function only fct = None for fct in cls['functions']: if fct['name'] == '__init__': break if fct is not None: argsFct = self.parseDocString(docstring=fct['desc']) argsFct['function'] = "%s::%s" % (adp['name'],cls['name']) argsFct['main-name'] = "%s" % adp['name'] argsFct['sub-name'] = "%s" % cls['name'] argsFct['is-default'] = "False" argsFct['is-generic'] = "True" if 'default-args' in fct: self.addDefaultValues(defaultValues=fct['default-args'], currentFunction=argsFct) adp_menu_generic.addAction(QtHelper.createAction(self, cls['name'], self.addAdapter, cb_arg=argsFct )) # adapters default menu_adps_default = QMenu("Extra", self) menu_adps.addMenu(menu_adps_default) if adapters_default is not None: for adp in adapters_default: adp_menu_default = QMenu(adp['name'], self) menu_adps_default.addMenu(adp_menu_default) for cls in adp['classes']: # extract __init__ function only fct = None for fct in cls['functions']: if fct['name'] == '__init__': break if fct is not None: argsFct = self.parseDocString(docstring=fct['desc']) argsFct['function'] = "%s::%s" % (adp['name'],cls['name']) argsFct['main-name'] = "%s" % adp['name'] argsFct['sub-name'] = "%s" % cls['name'] argsFct['is-default'] = "True" argsFct['is-generic'] = "False" if 'default-args' in fct: self.addDefaultValues(defaultValues=fct['default-args'], currentFunction=argsFct) adp_menu_default.addAction(QtHelper.createAction(self, cls['name'], self.addAdapter, cb_arg=argsFct )) indexes = self.selectedIndexes() if not indexes: self.delAction.setEnabled(False) self.menu.addAction( self.delAction ) self.menu.addSeparator() self.menu.addMenu( menu_adps ) self.menu.addSeparator() else: self.delAction.setEnabled(True) self.menu.addAction( self.delAction ) self.menu.addSeparator() self.menu.addMenu( menu_adps ) self.menu.addSeparator() self.menu.popup( self.mapToGlobal(pos) )
def createActions(self): """ Actions defined: * generate the cache for the documentation * generate all packages * refresh statistics * refresh the context of the server * check the syntax of adapters * reset statistics """ self.genCacheHelpAction = QtHelper.createAction( self, "&Generate\nDocumentations", self.genCacheHelp, tip='Generate the cache for the documentation', icon=QIcon(":/generate-doc.png")) self.genTarAdaptersAction = QtHelper.createAction( self, "&Package\nAdapters", self.genPackageAdapters, tip='Generate adapters packages', icon=QIcon(":/generate-tar.png")) self.genTarLibrariesAction = QtHelper.createAction( self, "&Package\nLibraries", self.genPackageLibraries, tip='Generate libraries packages', icon=QIcon(":/generate-tar.png")) self.genTarSamplesAction = QtHelper.createAction( self, "&Package\nSamples", self.genPackageSamples, tip='Generate samples packages', icon=QIcon(":/generate-tar.png")) self.refreshAction = QtHelper.createAction( self, "&Usages", self.refreshUsages, tip='Refresh Usages', tooltip='Refresh usages', icon=QIcon(":/refresh-statistics.png")) self.refreshCtxAction = QtHelper.createAction( self, "&Session", self.refreshCtx, tip='Refresh server context', tooltip='Refresh server context', icon=QIcon(":/act-refresh.png")) self.resetAction = QtHelper.createAction( self, "&Reset\nStatistics", self.resetStats, tip='Reset all statistics', icon=QIcon(":/reset-counter.png")) self.unlockAllTestsAction = QtHelper.createAction( self, "&Unlock\nTests", self.unlockTests, tip='Unlock all files', icon=QIcon(":/unlock.png")) self.unlockAllAdaptersAction = QtHelper.createAction( self, "&Unlock\nAdapters", self.unlockAdapters, tip='Unlock all files', icon=QIcon(":/unlock.png")) self.unlockAllLibrariesAction = QtHelper.createAction( self, "&Unlock\nLibraries", self.unlockLibraries, tip='Unlock all files', icon=QIcon(":/unlock.png"))
def createActions(self): """ QtActions creation Actions defined: * undo * redo * cut * copy * paste * delete * comment * uncomment """ self.undoAction = QtHelper.createAction(self, "Undo", callback=self.undo, icon=QIcon(":/undo.png"), shortcut="Ctrl+Z", tip='Undoes the last action') self.redoAction = QtHelper.createAction( self, "Redo", callback=self.redo, icon=QIcon(":/redo.png"), shortcut="Ctrl+Y", tip='Redoes the previously undone action') self.cutAction = QtHelper.createAction( self, "Cut", callback=self.cut, shortcut=QKeySequence.Cut, icon=QIcon(":/cut.png"), tip='Cuts the selection and puts it on the clipboard') self.copyAction = QtHelper.createAction( self, "Copy", callback=self.copy, shortcut=QKeySequence.Copy, icon=QIcon(":/copy.png"), tip='Copies the selection and puts it on the clipboard') self.pasteAction = QtHelper.createAction( self, "Paste", callback=self.paste, shortcut=QKeySequence.Paste, icon=QIcon(":/paste.png"), tip='Inserts clipboard contents') self.deleteAction = QtHelper.createAction( self, "Delete Selection", callback=self.removeSelectedText, tip='Deletes the selection') self.commentAction = QtHelper.createAction( self, "Comment", callback=self.comment, icon=QIcon(":/comment.png"), tip='Insert comment sign at the begining of line') self.uncommentAction = QtHelper.createAction( self, "Uncomment", callback=self.uncomment, icon=QIcon(":/uncomment.png"), tip='Remove comment sign at the begining of line') self.foldAllAction = QtHelper.createAction(self, "Fold\nUnfold", callback=self.foldAllLines, icon=QIcon(":/folding.png"), tip='Fold/Unfold all lines')
def createActions (self): """ Actions defined: * sort running task * sort waiting task * sort history task * kill one task * kill all tasks * cancel one task * cancel all task * clear the history * edit a waiting task * refresh waiting tasks * refresh running tasks * partial refresh of the history * complete refresh of the history * disable a waiting task * enable a waiting task """ self.sortAction = QtHelper.createAction(self, "Ascending Order", self.toggleSort, toggled = True, icon = QIcon(":/ascending.png") ) self.sortHistoryAction = QtHelper.createAction(self, "Ascending Order", self.toggleSortHistory, toggled = True, icon = QIcon(":/ascending.png") ) self.sortWaitingAction = QtHelper.createAction(self, "Ascending Order", self.toggleSortWaiting, toggled = True, icon = QIcon(":/ascending.png") ) self.killAction = QtHelper.createAction(self, "&Kill", self.killTask, tip = 'Kill selected test', icon = QIcon(":/process-kill.png") ) self.killAllAction = QtHelper.createAction(self, "&Kill All", self.killAllTasks, tip = 'Kill all running tests', icon = QIcon(":/process-killall.png") ) self.cancelAction = QtHelper.createAction(self, "&Cancel", self.cancelTask, tip = 'Cancel selected test', icon = QIcon(":/process-cancel.png") ) self.cancelAllAction = QtHelper.createAction(self, "&Cancel All", self.cancelAllTasks, tip = 'Cancel all waiting tests', icon = QIcon(":/processes-cancelall.png") ) self.clearHistoryAction = QtHelper.createAction(self, "&Clear history", self.clearHistory, tip = 'Clear history', icon = QIcon(":/trash.png")) self.editWaitingAction = QtHelper.createAction(self, "&Edit", self.editWaiting, tip = 'Edit the selected task', icon = QIcon(":/reschedule.png")) self.refreshWaitingAction = QtHelper.createAction(self, "Waiting tasks", self.refreshWaitingList, icon = QIcon(":/act-refresh.png"), tip="Refresh waiting tasks" ) self.refreshRunningAction = QtHelper.createAction(self, "Running tasks", self.refreshRunningList, icon = QIcon(":/act-refresh.png"), tip="Refresh running tasks" ) self.partialRefreshHistoryAction = QtHelper.createAction(self, "Partial history", self.partialRefreshHistoryList, icon = QIcon(":/act-half-refresh.png"), tip="Refresh partial history" ) self.refreshHistoryAction = QtHelper.createAction(self, "Full history", self.refreshHistoryList, icon = QIcon(":/act-refresh.png"), tip="Refresh full history" ) self.disableAction = QtHelper.createAction(self, "&Disable", self.disableTask, tip = 'Disable task', icon = QIcon(":/process-pause-icon.png") ) self.enableAction = QtHelper.createAction(self, "&Enable", self.enableTask, tip = 'Enable task', icon = None)