def execToolConfig(self): ''' Show the dialog box for executing a "tool config" A tool config is has a pointer to an existing tool (a "tool hook") but can provide an alternative configuration. ''' assert self.has_selected_item() # First we need to get the hooked node that we want to run node = self.selected_item().node hooked_tool_name = node.find('tool_hook').text hooked_tool_node = get_tool_node_by_name(self.project, hooked_tool_name) if hooked_tool_node is None: MessageBox.error( mainwindow=self.view, text='Invalid tool hook', detailed_text=( 'This tool config points to a tool named "%s" ' 'but there is no tool with that name in this project.' % hooked_tool_name)) return # Open up a GUI element and populate with variable's tool_lib_node = get_tool_library_node(self.project) params = {'tool_path': get_path_to_tool_modules(self.project)} window = ExecuteToolGui(parent_widget=self.manager.base_widget, tool_node=hooked_tool_node, tool_config=node, tool_library_node=tool_lib_node, params=params) window.setModal(True) window.show()
def execToolConfig(self): ''' Show the dialog box for executing a "tool config" A tool config is has a pointer to an existing tool (a "tool hook") but can provide an alternative configuration. ''' assert self.has_selected_item() # First we need to get the hooked node that we want to run node = self.selected_item().node hooked_tool_name = node.find('tool_hook').text hooked_tool_node = get_tool_node_by_name(self.project, hooked_tool_name) if hooked_tool_node is None: MessageBox.error(mainwindow = self.view, text = 'Invalid tool hook', detailed_text = ('This tool config points to a tool named "%s" ' 'but there is no tool with that name in this project.' % hooked_tool_name)) return # Open up a GUI element and populate with variable's tool_lib_node = get_tool_library_node(self.project) params = {'tool_path': get_path_to_tool_modules(self.project)} window = ExecuteToolGui(parent_widget = self.manager.base_widget, tool_node = hooked_tool_node, tool_config = node, tool_library_node = tool_lib_node, params=params, model=self.model) window.setModal(True) window.show()
def dataActionMenuFunction(self,action): QObject.disconnect(self.menu, SIGNAL("triggered(QAction*)"),self.dataActionMenuFunction) if action != self.actRefresh: actiontext = str(action.text()) tool_node = self.dynactions[actiontext] filename = self.model.fileName(self.currentIndex) filepath = self.model.filePath(self.currentIndex) parentfilepath = self.model.filePath(self.currentIndex.parent()) params = self.getOptionalParams() window = ExecuteToolGui(parent_widget = self.treeview, tool_node = tool_node, tool_config = None, tool_library_node = self.tool_library_node, params=params) window.show() return
def dataActionMenuFunction(self, action): QObject.disconnect(self.menu, SIGNAL("triggered(QAction*)"), self.dataActionMenuFunction) if action != self.actRefresh: actiontext = str(action.text()) tool_node = self.dynactions[actiontext] filename = self.model.fileName(self.currentIndex) filepath = self.model.filePath(self.currentIndex) parentfilepath = self.model.filePath(self.currentIndex.parent()) params = self.getOptionalParams() window = ExecuteToolGui(parent_widget=self.treeview, tool_node=tool_node, tool_config=None, tool_library_node=self.tool_library_node, params=params) window.show() return