def updateView(self): from gui.vistrails_window import _app if self.vtversion > 0: if self.mshpController is not None: self.mshpController.versionChanged.disconnect(self.mshpVersionChanged) self.mshpController.stateChanged.disconnect(self.mshpStateChanged) if self.mshpController.vtController is not None: self.disconnect(self.mshpController.vtController, QtCore.SIGNAL('vistrailChanged()'), self.mshpControllerVistrailChanged) self.controller.flush_delayed_actions() self.vtversion = self.controller.current_version self.mshpController = self.manager.createMashupController(self.controller, self.vtversion) #self.pipelineTab.set_controller(self.mshpController.vtController) #self.pipelineTab.set_to_current() self.mshpController.vtController.change_selected_version(self.vtversion) self.connect(self.mshpController.vtController, QtCore.SIGNAL('vistrailChanged()'), self.mshpControllerVistrailChanged) self.mshpController.versionChanged.connect(self.mshpVersionChanged) self.mshpController.stateChanged.connect(self.mshpStateChanged) self.aliasPanel.updateController(self.mshpController) self.clearPreviewTabs() _app.notify('mshpcontroller_changed', self.mshpController)
def updateView(self): from gui.vistrails_window import _app if self.vtversion > 0: if self.mshpController is not None: self.mshpController.versionChanged.disconnect( self.mshpVersionChanged) self.mshpController.stateChanged.disconnect( self.mshpStateChanged) if self.mshpController.vtController is not None: self.disconnect(self.mshpController.vtController, QtCore.SIGNAL('vistrailChanged()'), self.mshpControllerVistrailChanged) self.controller.flush_delayed_actions() self.vtversion = self.controller.current_version self.mshpController = self.manager.createMashupController( self.controller, self.vtversion) #self.pipelineTab.set_controller(self.mshpController.vtController) #self.pipelineTab.set_to_current() self.mshpController.vtController.change_selected_version( self.vtversion) self.connect(self.mshpController.vtController, QtCore.SIGNAL('vistrailChanged()'), self.mshpControllerVistrailChanged) self.mshpController.versionChanged.connect(self.mshpVersionChanged) self.mshpController.stateChanged.connect(self.mshpStateChanged) self.aliasPanel.updateController(self.mshpController) self.clearPreviewTabs() _app.notify('mshpcontroller_changed', self.mshpController)
def notify_app(self, wf_execution, execution): # make sure it is only called once if self.isUpdating: return self.isUpdating = True from gui.vistrails_window import _app _app.notify("execution_changed", wf_execution, execution) self.isUpdating = False
def set_to_search_mode(self): self.set_display_view(QQueryView.VISUAL_SEARCH_VIEW) self.query_box.backButton.setEnabled(False) self.query_box.editButton.setEnabled(False) self.set_reset_button(self.p_controller.current_pipeline) from gui.vistrails_window import _app _app.notify('query_pipeline_changed', self.p_controller.current_pipeline)
def mshpVersionChanged(self, versionId): from gui.vistrails_window import _app #print "*** mshpVersionChanged ", versionId self.aliasPanel.updateVersion(versionId) if not self.mshpController.versionHasTag(versionId): self.saveAction.setEnabled(True) else: self.saveAction.setEnabled(False) _app.notify('mshpversion_changed', versionId)
def set_to_result_mode(self): self.set_display_view(self.current_result_view) self.query_box.backButton.setEnabled(True) if self.query_controller.level >= QueryController.LEVEL_VISTRAIL: self.query_box.editButton.setEnabled(True) self.query_box.setManualResetEnabled(True) from gui.vistrails_window import _app _app.notify('query_pipeline_changed', self.p_controller.current_pipeline)
def reset_search(self): self.search = None self.search_pipeline = None self.query_view.pipeline_view.controller.change_selected_version(0) self.query_view.pipeline_view.scene().setupScene( self.query_view.pipeline_view.controller.current_pipeline) self.query_view.set_to_search_mode() self.query_view.query_box.searchBox.clearSearch() self.query_view.vistrailChanged() from gui.vistrails_window import _app _app.notify("search_changed", None, None)
def execute(self): res = self.controller.execute_current_workflow() from gui.vistrails_window import _app if len(res[0][0].errors) > 0: _app.qactions['pipeline'].trigger() _app.notify('execution_updated')
def run_search(self, search_str=None): """ set_search(search_str: str) -> None Change the currrent version tree search statement """ search_pipeline = \ self.query_view.pipeline_view.scene().current_pipeline if search_str is None: search_str = self.query_view.query_box.getCurrentText() self.query_view.update_controller() if self.search is None or \ self.search.search_str != search_str or \ self.search.queryPipeline != search_pipeline or \ self.query_view.p_controller.changed or \ self.search_level > self.level: self.search_str = search_str self.search_pipeline = search_pipeline self.search_level = self.level # reset changed here self.query_view.p_controller.set_changed(False) vt_controller = self.query_view.vt_controller current_vistrail = self.vt_controller.vistrail def do_search(only_current_vistrail=False, only_current_workflow=False): entities_to_check = {} open_col = Collection.getInstance() for entity in open_col.get_current_entities(): if entity.type_id == VistrailEntity.type_id and \ entity.is_open: controller = entity._window.controller if only_current_vistrail and \ controller.vistrail != vt_controller.vistrail: continue if only_current_workflow: versions_to_check = controller.current_version else: graph = controller._current_terse_graph versions_to_check = set(graph.vertices.iterkeys()) entities_to_check[entity] = versions_to_check self.set_search(MultipleSearch(search_str, search_pipeline, entities_to_check)) self.search.run() return self.search.getResultEntities() if self.level == QueryController.LEVEL_VISTRAIL: result_entities = do_search(True) self.show_vistrail_matches() elif self.level == QueryController.LEVEL_WORKFLOW: self.search_level = QueryController.LEVEL_VISTRAIL result_entities = do_search(True) self.update_version_tree() self.show_workflow_matches() elif self.level == QueryController.LEVEL_ALL: result_entities = do_search() self.show_global_matches() from gui.vistrails_window import _app _app.notify("search_changed", self.search, result_entities) else: self.query_view.set_to_result_mode()
def vistrailChanged(self): from gui.vistrails_window import _app self.p_controller.current_pipeline.ensure_connection_specs() _app.notify('query_pipeline_changed', self.p_controller.current_pipeline)
def configureDone(self): from gui.vistrails_window import _app self.emit(QtCore.SIGNAL('doneConfigure'), self.module.id) _app.notify('module_done_configure', self.module.id)
def exploreChange(self, on): from gui.vistrails_window import _app _app.notify('explore_changed', on)
def execute(self, params): from gui.vistrails_window import _app result = BaseController.execute(self, params) _app.notify('execution_updated') return result
def aliasChanged(self, param): from gui.vistrails_window import _app _app.notify('alias_changed', param)