def __init__(self, parent=None): """ QVersionTab(parent: QWidget) -> QVersionTab Make it a main window with dockable area and a QVersionTreeView in the middle """ QDockContainer.__init__(self, parent) self.setWindowTitle('Version Tree') self.versionView = QVersionTreeView() self.setCentralWidget(self.versionView) self.toolWindow().setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures) self.toolWindow().hide() self.versionProp = QVersionProp(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.versionProp.toolWindow()) self.controller = None self.connect(self.toolWindow(), QtCore.SIGNAL('topLevelChanged(bool)'), self.updateWindowTitle) self.connect(self.versionView.scene(), QtCore.SIGNAL('twoVersionsSelected(int,int)'), self.twoVersionsSelected) self.connect(self.versionView.scene(), QtCore.SIGNAL('addToBookmarks'), self.add_bookmark) self.connect(self.versionView, QtCore.SIGNAL('resetQuery()'), self.resetQuery)
def __init__(self, parent=None): """ QParameterExplorationTab(parent: QWidget) -> QParameterExplorationTab Make it a main window with dockable area and a QParameterExplorationTable """ QDockContainer.__init__(self, parent) self.setWindowTitle('Parameter Exploration') self.toolWindow().setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures) self.toolWindow().hide() self.peWidget = QParameterExplorationWidget() self.setCentralWidget(self.peWidget) self.connect(self.peWidget.table, QtCore.SIGNAL('exploreChange(bool)'), self.exploreChange) self.paramView = QParameterView(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.paramView.toolWindow()) self.annotatedPipelineView = QAnnotatedPipelineView(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.annotatedPipelineView.toolWindow()) self.virtualCell = QVirtualCellWindow(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.virtualCell.toolWindow()) self.controller = None self.currentVersion = -1
def __init__(self, parent=None): """ QVersionTab(parent: QWidget) -> QVersionTab Make it a main window with dockable area and a QVersionTreeView in the middle """ QDockContainer.__init__(self, parent) self.setWindowTitle('Version Tree') self.versionView = QVersionTreeView() self.setCentralWidget(self.versionView) self.toolWindow().setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures) self.toolWindow().hide() self.versionProp = QVersionProp(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.versionProp.toolWindow()) self.controller = None self.connect(self.toolWindow(), QtCore.SIGNAL('topLevelChanged(bool)'), self.updateWindowTitle) self.connect(self.versionView.scene(), QtCore.SIGNAL('twoVersionsSelected(int,int)'), self.twoVersionsSelected) self.connect(self.versionView, QtCore.SIGNAL('resetQuery()'), self.resetQuery)
def __init__(self, parent=None): """ QPipelineTab(parent: QWidget) -> QPipelineTab Make it a main window with dockable area and a QPipelineView in the middle """ QDockContainer.__init__(self, parent) self.setWindowTitle('Pipeline') self.pipelineView = QPipelineView() self.pipelineView.scene().pipeline_tab = proxy(self) self.setCentralWidget(self.pipelineView) self.toolWindow().setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures) self.toolWindow().hide() self.methodPalette = QMethodPalette(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.methodPalette.toolWindow()) self.moduleMethods = QModuleMethods(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.moduleMethods.toolWindow()) self.connect(self.toolWindow(), QtCore.SIGNAL('topLevelChanged(bool)'), self.updateWindowTitle) self.connect(self.pipelineView.scene(), QtCore.SIGNAL('moduleSelected'), self.moduleSelected) self.connect(self.pipelineView, QtCore.SIGNAL('resetQuery()'), self.resetQuery) self.controller = None
def __init__(self, parent=None): """ QPipelineTab(parent: QWidget) -> QPipelineTab Make it a main window with dockable area and a QPipelineView in the middle """ QDockContainer.__init__(self, parent) self.setWindowTitle('Pipeline') self.pipelineView = QPipelineView() self.pipelineView.scene().pipeline_tab = proxy(self) self.setCentralWidget(self.pipelineView) self.toolWindow().setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures) self.toolWindow().hide() self.methodPalette = QMethodPalette(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.methodPalette.toolWindow()) self.moduleMethods = QModuleMethods(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.moduleMethods.toolWindow()) self.moduleConfig = QModuleConfiguration(self, self.pipelineView.scene()) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.moduleConfig.toolWindow()) self.vistrailVars = QVistrailVariables(self) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.vistrailVars.toolWindow()) self.connect(self.toolWindow(), QtCore.SIGNAL('topLevelChanged(bool)'), self.updateWindowTitle) self.connect(self.pipelineView.scene(), QtCore.SIGNAL('moduleSelected'), self.moduleSelected) self.connect(self.moduleConfig, QtCore.SIGNAL('doneConfigure'), self.pipelineView.scene().perform_configure_done_actions) self.connect(self.pipelineView.scene(), QtCore.SIGNAL('showConfigureWindow'), self.moduleConfig.activate) self.connect(self.pipelineView, QtCore.SIGNAL('resetQuery()'), self.resetQuery) self.controller = None
def closeEvent(self, event): """ closeEvent(event: QCloseEvent) -> None Only close if we save information """ if self.closeEventHandler: if self.closeEventHandler(self): event.accept() else: event.ignore() else: #I think there's a problem with two pipeline views and the same #scene on Macs. After assigning a new scene just before deleting #seems to solve the problem self.peTab.annotatedPipelineView.setScene(QtGui.QGraphicsScene()) return QDockContainer.closeEvent(self, event)
def __init__(self, parent=None): """ QVistrailItem(parent: QWidget) -> QVistrailItem Make it a main window with dockable area """ QDockContainer.__init__(self, parent) # The window title is the name of the vistrail file self.setWindowTitle('untitled%s'%vistrails_default_file_type()) # Create the views self.pipelineTab = QPipelineTab() self.versionTab = QVersionTab() self.connect(self.versionTab.versionProp, QtCore.SIGNAL('textQueryChange(bool)'), self.setQueryMode) self.pipelineTab.pipelineView.setPIPScene( self.versionTab.versionView.scene()) self.versionTab.versionView.setPIPScene( self.pipelineTab.pipelineView.scene()) self.versionTab.versionView.scene()._pipeline_scene = self.pipelineTab.pipelineView.scene() self.queryTab = QQueryTab() self.peTab = QParameterExplorationTab() self.peTab.annotatedPipelineView.setScene( self.pipelineTab.pipelineView.scene()) # Setup a central stacked widget for pipeline view and version # tree view self.stackedWidget = QtGui.QStackedWidget() self.setCentralWidget(self.stackedWidget) self.stackedWidget.addWidget(self.pipelineTab) self.stackedWidget.addWidget(self.versionTab) self.stackedWidget.addWidget(self.queryTab) self.stackedWidget.addWidget(self.peTab) self.stackedWidget.setCurrentIndex(1) # Initialize the vistrail controller self.controller = VistrailController() self.controller.vistrail_view = self self.connect(self.controller, QtCore.SIGNAL('stateChanged'), self.stateChanged) self.connect(self.controller, QtCore.SIGNAL('new_action'), self.new_action) self.connect(self.versionTab.versionView.scene(), QtCore.SIGNAL('versionSelected(int,bool)'), self.versionSelected) self.connect(self.versionTab, QtCore.SIGNAL('twoVersionsSelected(int,int)'), self.twoVersionsSelected) self.connect(self.queryTab, QtCore.SIGNAL('queryPipelineChange'), self.queryPipelineChange) self.connect(self.peTab, QtCore.SIGNAL('exploreChange(bool)'), self.exploreChange) # We also keep track where this vistrail comes from # So we can save in the right place self.locator = None self.closeEventHandler = None # the redo stack stores the undone action ids # (undo is automatic with us, through the version tree) self.redo_stack = [] # Keep the state of the execution button and menu items for the view self.execQueryEnabled = False self.execDiffEnabled = False self.execExploreEnabled = False self.execPipelineEnabled = False self.execDiffId1 = -1 self.execDiffId2 = -1