コード例 #1
0
    def timeStats(self, versions):
        """ timeStats(versions: [int, int]) -> None
        Show a time histogram

        """
        if versions[0] < versions[1]:
            start = versions[0]
            end = versions[1]
        else:
            start = versions[1]
            end = versions[0]
        controller = self.viewManager.currentWidget().controller
        if not controller.is_parent(start, end):
            self.showStatusWarning('Selection failed', 'Versions not part of the same branch')
            self.hideTimeStats()
            return
        def finishTimeStats():
            from plugin.pgui.histogram_window import QTimeStatisticsWindow
            if self.timeStatsWindow==None:
                self.timeStatsWindow=QTimeStatisticsWindow(self)
            self.timeStatsWindow.compute(start,end)
            self.connect(self.timeStatsWindow,
                         QtCore.SIGNAL('closed'),
                         self.hideTimeStats)
            self.timeStatsWindow.exec_()
        CaptureAPI.executeDeferred(finishTimeStats)
コード例 #2
0
def QVM_newVistrail(self, recover_files=True, callBeforeNewVistrail=True):
    """ newVistrail() -> (None or QVistrailView)
    Create a new vistrail with no name. If user cancels process,
    returns None.

    FIXME: We should do the interactive parts separately.
    
    """
    if self.single_document_mode and self.currentView():
        if not self.closeVistrail():
            return None

    # we're actually going to do it
    if callBeforeNewVistrail:
        import CaptureAPI
        CaptureAPI.beforeNewVistrail()

    if recover_files and untitled_locator().has_temporaries():
        import copy
        locator = copy.copy(untitled_locator())
        vistrail = locator.load()
    else:
        locator = None
        vistrail = Vistrail()
    return self.set_vistrail_view(vistrail, locator)
コード例 #3
0
 def keepViewChanged(self, checked=True):
     """ Update app settings accordingly """
     if checked:
         self.keepViewAction.setIcon(CurrentTheme.VIEW_ON_ICON)
         CaptureAPI.setPreference('VisTrailsUseRecordedViews', '0')
     else:
         self.keepViewAction.setIcon(CurrentTheme.VIEW_OFF_ICON)
         CaptureAPI.setPreference('VisTrailsUseRecordedViews', '1')
コード例 #4
0
 def createSnapshot(self):
     """ createSnapshot() -> None
     Store the contents of the scene in an new version
     
     """
     controller = self.viewManager.currentWidget().controller
     if controller.current_version > 0:
         CaptureAPI.createSnapshot()
コード例 #5
0
 def playNextVersion(self):
     """ Walk to the next version and wait a delay """
     if self.showNextVersion():
         def startTimer():
             time.sleep(self.getDelay())
             self.playerTimer.stop()
             self.playerTimer.start()
         CaptureAPI.executeDeferred(startTimer)
     elif self.playPauseAction.text()=='Pause':
         self.playPauseTriggered()
コード例 #6
0
    def hideVisualDiff(self,accepted=True):
        """ hideVisualDiff(accepted: bool) -> None
        Clean up the visual diff interface.
        """
        self.getVersionView().multiSelectionAbort('Visual Difference')
        CaptureAPI.stopVisualDiff()

        self.messageDialog.reject()
        MessageDialogContainer.instance().unregisterDialog(self.messageDialog)

        controller = self.viewManager.currentWidget().controller
        controller.update_app_with_current_version(0, False)
コード例 #7
0
ファイル: patch.py プロジェクト: gzt200361/ThirdParty-2.0.0
    def finish(cls, accepted):
        """ Clean up everything """
        if accepted:
            for (ops, description, details) in cls.patchOps:
                opstr = ""
                for op in ops:
                    opstr += op
                    cls.controller.update_scene_script(description, details, 0, opstr)
        else:
            cls.controller.update_app_with_current_version(0, False)

        CaptureAPI.refreshApp()
        cls.restoreVisTrails()
コード例 #8
0
 def pasteOperation(self):
     self.hidePlayback()
     def finishPaste():
         PluginPatch.paste()
         self.messageDialog = QMessageDialog('Accept', 'Discard',
                                             'Applied ' + PluginPatch.getReportText() +
                                             ' operation(s).\nAccept the paste?', self)
         self.connect(self.messageDialog,
                      QtCore.SIGNAL('accepted'),
                      self.hidePaste)
         self.messageDialog.show()
         MessageDialogContainer.instance().registerDialog(self.messageDialog)
     CaptureAPI.executeDeferred(finishPaste)
コード例 #9
0
ファイル: patch.py プロジェクト: gzt200361/ThirdParty-2.0.0
 def performPatching(cls):
     """ Actual run the ops to generate the scene """
     cls.controller.change_selected_version(cls.selectedVersion)
     cls.failedOps = []
     cls.totalOpsCount = 0
     for (ops, description, details) in cls.patchOps:
         cls.totalOpsCount += len(ops)
         for op in ops:
             try:
                 CaptureAPI.unpickleAndPerformOperation(op)
             except:
                 pass
     CaptureAPI.refreshApp()
コード例 #10
0
    def quitVistrails(self):
        """ quitVistrails() -> bool
        Quit Vistrail, return False if not succeeded

        """
        if self.viewManager.closeAllVistrails():
            CaptureAPI.unloadPlugin()

        # clean up the temporary directory
        if not self.dbDefault:
            core.system.clean_temporary_save_directory()

        return False
コード例 #11
0
 def open_vistrail_without_prompt(self, locator, version=None,
                                  execute_workflow=False):
     """open_vistrail_without_prompt(locator_class, version: int or str,
                                     execute_workflow: bool) -> None
     Open vistrail depending on the locator class given.
     If a version is given, the workflow is shown on the Pipeline View.
     I execute_workflow is True the workflow will be executed.
     """
     if not locator.is_valid():
             ok = locator.update_from_gui()
     else:
         ok = True
     if ok:
         # TODO: Passing in False here breaks the without_prompt intention
         # of the code, but do we even need the distinction in the plug-in?
         view = self.viewManager.open_vistrail(locator, version, False)
         if view == None:
             return
         if CaptureAPI.isReadOnly():
             self.addonToolBar.setEnabled(True)
             self.interactionToolBar.setEnabled(True)
             self.editMenu.setEnabled(True)
             self.toolsMenu.setEnabled(True)
             self.viewMenu.setEnabled(True)
         else:
             self.saveFileAsAction.setEnabled(True)
         if version:
             self.emit(QtCore.SIGNAL("changeViewState(int)"), 0)
             self.viewModeChanged(0)
         else:
             self.emit(QtCore.SIGNAL("changeViewState(int)"), 1)
             self.viewModeChanged(1)
         if execute_workflow:
             self.execute_current_pipeline()
コード例 #12
0
    def create_first_vistrail(self):
        """ create_first_vistrail() -> None

        """
        # FIXME: when interactive and non-interactive modes are separated,
        # this autosave code can move to the viewManager
        if not self.dbDefault and untitled_locator().has_temporaries():
            if not FileLocator().prompt_autosave(self):
                untitled_locator().clean_temporaries()

        if self.viewManager.newVistrail(True, False):
            self.viewModeChanged(1)
        self.viewManager.set_first_view(self.viewManager.currentView())
        
        # Pre-compute default values for existing nodes in a new scene
        controller = self.viewManager.currentWidget().controller
        controller.store_preset_attributes()
        controller.change_selected_version(0)
        self.connect(controller,
                     QtCore.SIGNAL('versionWasChanged'),
                     self.versionSelectionChange)

        self.updateAddonToolBar(self.viewManager.currentWidget())
        
        if CaptureAPI.isReadOnly():
            self.viewManager.currentWidget().hide()
            self.addonToolBar.setEnabled(False)
            self.interactionToolBar.setEnabled(False)
            self.editMenu.setEnabled(False)
            self.toolsMenu.setEnabled(False)
            self.viewMenu.setEnabled(False)
            self.open_vistrail_default()
コード例 #13
0
    def vistrailChanged(self):
        """ vistrailChanged() -> None
        An action was performed on the current vistrail

        """
        if not CaptureAPI.isReadOnly():
            self.saveFileAction.setEnabled(True)
            self.saveFileAsAction.setEnabled(True)
コード例 #14
0
 def showNextVersion(self):
     """ Show the next version and return True if there are more
     to show """
     if (not self.isVisible() or self.playPauseAction.text()=='Play'):
         return False
     
     if self.currentFrame+1>=len(self.frames):
         return False
     
     if self.frames[self.currentFrame]!=self.controller.current_version:
         self.controller.change_selected_version(self.frames[self.currentFrame])
     else:
         self.setCurrentFrame(self.currentFrame+1)
         self.controller.change_selected_version(self.frames[self.currentFrame])
     CaptureAPI.refreshApp()
     
     return self.currentFrame+1<len(self.frames)
コード例 #15
0
 def showVisualDiff(self, versions):
     """ Show the visual diff window """
     startVersion=versions[0]
     endVersion=versions[1]
     controller=self.viewManager.currentWidget().controller
     commonVersion=controller.vistrail.getFirstCommonVersion(startVersion,endVersion)
     CaptureAPI.startVisualDiff(commonVersion,startVersion,endVersion)
     def finishVisualDiff():
         self.messageDialog = QMessageDialog('Close', None,
                                             'Close the Visual Difference?',
                                             self)
         self.connect(self.messageDialog,
                      QtCore.SIGNAL('accepted'),
                      self.hideVisualDiff)
         self.messageDialog.show()
         MessageDialogContainer.instance().registerDialog(self.messageDialog)
         #self.hideVisualDiff(self.messageDialog.execute()=='accepted')
     CaptureAPI.executeDeferred(finishVisualDiff)
コード例 #16
0
def VC_open_vistrail(self, locator_class):
    """ open_vistrail(locator_class) -> None
    Prompt user for information to get to a vistrail in different ways,
    depending on the locator class given.
    """
    locator = locator_class.load_from_gui(self, Vistrail.vtType)
    if locator:
        if locator.has_temporaries():
            # Don't prompt for autosave if the user is reloading the same file from
            # last save
            current_locator = self.viewManager.currentWidget().controller.locator
            if (current_locator and current_locator.name == locator.name) or not locator_class.prompt_autosave(self):
                locator.clean_temporaries()
        try:
            name = locator._get_name()
        except:
            name = ""
        CaptureAPI.beforeOpenVistrail(name)
        self.open_vistrail_without_prompt(locator)
        CaptureAPI.afterOpenVistrail()
コード例 #17
0
    def newVistrail(self):
        """ newVistrail() -> None
        Start a new vistrail

        """

        # may have cancelled the new
        if not QBuilderWindow.newVistrail(self):
            return

        self.viewModeChanged(1)

        # Pre-compute default values for existing nodes in a new scene
        controller = self.viewManager.currentWidget().controller
        controller.store_preset_attributes()
        self.connect(controller,
                     QtCore.SIGNAL('versionWasChanged'),
                     self.versionSelectionChange)
        self.updateAddonToolBar(self.viewManager.currentWidget())
        CaptureAPI.afterNewVistrail()
コード例 #18
0
 def versionSelectionChange(self, versionId):
     """ versionSelectionChange(versionId: int) -> None
     Setup state of actions
     
     """
     self.undoAction.setEnabled(versionId>0)
     currentView = self.viewManager.currentWidget()
     if currentView:
         self.redoAction.setEnabled(currentView.can_redo())
     else:
         self.redoAction.setEnabled(False)
     if not CaptureAPI.isReadOnly():
         self.snapshotAction.setEnabled(versionId>0)
コード例 #19
0
 def setSpeed(self, checked):
     """ set the playback speed"""
     if self.slowAction.isChecked():
         CaptureAPI.setPreference('VisTrailsPlaybackSpeed',str(0))
     elif self.mediumAction.isChecked():
         CaptureAPI.setPreference('VisTrailsPlaybackSpeed',str(1))
     else:
         CaptureAPI.setPreference('VisTrailsPlaybackSpeed',str(2))
コード例 #20
0
    def currentVistrailChanged(self, vistrailView):
        """ currentVistrailChanged(vistrailView: QVistrailView) -> None
        Redisplay the new title of vistrail

        """
        self.execStateChange()
        if vistrailView:
            self.setWindowTitle(self.title + ' - ' +
                                vistrailView.windowTitle())
            if not CaptureAPI.isReadOnly():
                self.saveFileAction.setEnabled(True)
                self.saveFileAsAction.setEnabled(True)
        else:
            self.setWindowTitle(self.title)
            self.saveFileAction.setEnabled(False)
            self.saveFileAsAction.setEnabled(False)

        if vistrailView and vistrailView.viewAction:
            vistrailView.viewAction.setText(vistrailView.windowTitle())
            if not vistrailView.viewAction.isChecked():
                vistrailView.viewAction.setChecked(True)
コード例 #21
0
def QVM_save_vistrail(self, locator_class,
                      vistrailView=None,
                      force_choose_locator=False):
    """
    
    force_choose_locator=True triggers 'save as' behavior
    """
    import CaptureAPI
    if CaptureAPI.isReadOnly():
        return False

    if not vistrailView:
        vistrailView = self.currentWidget()
    vistrailView.flush_changes()
    
    if vistrailView:
        gui_get = locator_class.save_from_gui
        # get a locator to write to
        if force_choose_locator:
            locator = gui_get(self, Vistrail.vtType,
                              vistrailView.controller.locator)
        else:
            locator = (vistrailView.controller.locator or
                       gui_get(self, Vistrail.vtType,
                               vistrailView.controller.locator))
        if locator == untitled_locator():
            locator = gui_get(self, Vistrail.vtType,
                                  vistrailView.controller.locator)
        # if couldn't get one, ignore the request
        if not locator:
            return False
        try:
            vistrailView.controller.write_vistrail(locator)
        except Exception, e:
            QtGui.QMessageBox.critical(None,
                                       'Vistrails',
                                       str(e))
            return False
        return True
コード例 #22
0
def get_file_directory():
    file_dir = core.system.vistrails_file_directory()
    if file_dir == "":
        file_dir = CaptureAPI.getDefaultFileDirectory()
    return file_dir
コード例 #23
0
    def createActions(self):
        """ createActions() -> None
        Construct Plug-in specific actions

        """
        QBuilderWindow.createActions(self)

        # Modify Core Actions
        self.redoAction.setShortcuts(['Shift+Z','Ctrl+Y'])
        self.quitVistrailsAction = QtGui.QAction('Quit Plug-In', self)
        self.quitVistrailsAction.setShortcut('Ctrl+Q')
        self.quitVistrailsAction.setStatusTip('Exit Plug-In')
        self.editPreferencesAction.setStatusTip('Edit plug-in preferences')
        self.helpAction = QtGui.QAction(self.tr('About Provenance Explorer...'), self)

        # Create plugin specific actions
        self.keepViewAction = QtGui.QAction(CurrentTheme.VIEW_ON_ICON, 'Lock View', self)
        self.keepViewAction.setEnabled(True)
        self.keepViewAction.setCheckable(True)
        if int(CaptureAPI.getPreference('VisTrailsUseRecordedViews')):
            self.keepViewAction.setChecked(0)
            self.keepViewAction.setIcon(CurrentTheme.VIEW_OFF_ICON)
        else:
            self.keepViewAction.setChecked(1)
        self.keepViewAction.setStatusTip('Lock the current view settings while navigating versions')

        self.expandBranchAction = QtGui.QAction('Expand Branch', self)
        self.expandBranchAction.setEnabled(True)
        self.expandBranchAction.setStatusTip('Expand all versions in the tree below the current version')

        self.collapseBranchAction = QtGui.QAction('Collapse Branch', self)
        self.collapseBranchAction.setEnabled(True)
        self.collapseBranchAction.setStatusTip('Collapse all expanded versions in the tree below the current version')

        self.collapseAllAction = QtGui.QAction('Collapse All', self)
        self.collapseAllAction.setEnabled(True)
        self.collapseAllAction.setStatusTip('Collapse all expanded branches of the tree')

        self.hideBranchAction = QtGui.QAction('Hide Branch', self)
        if core.system.systemType in ['Darwin']:
            self.hideBranchAction.setShortcut('Meta+H')
        else:
            self.hideBranchAction.setShortcut('Ctrl+H')
        self.hideBranchAction.setEnabled(True)
        self.hideBranchAction.setStatusTip('Hide all versions in the tree including and below the current version')

        self.showAllAction = QtGui.QAction('Show All', self)
        self.showAllAction.setEnabled(True)
        self.showAllAction.setStatusTip('Show all hidden versions')

        self.resetViewAction = QtGui.QAction('Frame All', self)
        if core.system.systemType in ['Darwin']:
            self.resetViewAction.setShortcut('Meta+A')
        else:
            self.resetViewAction.setShortcut('A')
        self.resetViewAction.setShortcutContext(QtCore.Qt.WidgetShortcut)
        self.resetViewAction.setStatusTip('Reset tree view to show all versions')

        self.focusViewAction = QtGui.QAction('Frame Selection', self)
        if core.system.systemType in ['Darwin']:
            self.focusViewAction.setShortcut('Meta+F')
        else:
            self.focusViewAction.setShortcut('F')
        self.focusViewAction.setShortcutContext(QtCore.Qt.WidgetShortcut)
        self.focusViewAction.setStatusTip('Reset tree view to show selected version')

        self.timeStatsAllAction = QtGui.QAction('Compute Statistics', self)
        self.timeStatsAllAction.setEnabled(True)
        self.timeStatsAllAction.setStatusTip('Show time statistics for entire version tree')
        
        self.timeStatsAction = QtGui.QAction('Compute Sequence Statistics...', self)
        self.timeStatsAction.setEnabled(True)
        self.timeStatsAction.setStatusTip('Show time statistics between two versions')

        self.snapshotAction = QtGui.QAction('Create Snapshot', self)
        self.snapshotAction.setEnabled(False)
        self.snapshotAction.setStatusTip('Create a new version with the contents of the current scene')

        self.visDiffAction = QtGui.QAction('Compute Visual Difference...', self)
        self.visDiffAction.setEnabled(True)
        self.visDiffAction.setStatusTip('Visually display differences between two versions')

        self.copyOperationAction = QtGui.QAction('Copy', self)
        self.copyOperationAction.setShortcut('Ctrl+C')
        self.copyOperationAction.setEnabled(True)
        self.copyOperationAction.setStatusTip('Copy the selected operation to the clipboard')

        self.copySequenceAction = QtGui.QAction('Copy Sequence...', self)
        self.copySequenceAction.setEnabled(True)
        self.copySequenceAction.setStatusTip('Copy a sequence of operations to the clipboard')

        self.pasteOperationAction = QtGui.QAction('Paste', self)
        self.pasteOperationAction.setShortcut('Ctrl+V')
        self.pasteOperationAction.setEnabled(False)
        self.pasteOperationAction.setStatusTip('Paste operations from the clipboard to selected version')

        # Reader
        if CaptureAPI.isReadOnly():
            self.newVistrailAction.setText('&New (Pro)')
            self.newVistrailAction.setEnabled(False)
            self.saveFileAction.setText('&Save (Pro)')
            self.saveFileAction.setEnabled(False)
            self.saveFileAsAction.setText('Save as... (Pro)')
            self.saveFileAsAction.setEnabled(False)
            self.timeStatsAllAction.setText('Compute Statistics... (Pro)')
            self.timeStatsAllAction.setEnabled(False)
            self.timeStatsAction.setText('Compute Sequence Statistics... (Pro)')
            self.timeStatsAction.setEnabled(False)
            self.snapshotAction.setText('Take Snapshot (Pro)')
            self.snapshotAction.setEnabled(False)
            self.copyOperationAction.setText('Copy (Pro)')
            self.copyOperationAction.setEnabled(False)
            self.copySequenceAction.setText('Copy Sequence... (Pro)')
            self.copySequenceAction.setEnabled(False)
            self.pasteOperationAction.setText('Paste (Pro)')
            self.pasteOperationAction.setEnabled(False)
            self.hideBranchAction.setText('Hide Branch (Pro)')
            self.hideBranchAction.setEnabled(False)
            self.showAllAction.setText('Show All (Pro)')
            self.showAllAction.setEnabled(False)
コード例 #24
0
def CPP_versionSelected(self, versionId, byClick):
    original_versionSelected(self,versionId,byClick)
    import CaptureAPI
    CaptureAPI.afterVersionSelectedByUser()
コード例 #25
0
    def __init__(self, parent=None):
        """ QPlaybackToolBar(parent: QWidget) -> QPlaybackToolBar
        
        """
        QAddonToolBar.__init__(self, parent)

        self.setWindowTitle('Playback')
        self.setIconSize(QtCore.QSize(16, 16))

        # Play/Pause/Stop Buttons
        self.playPauseAction = QtGui.QAction(CurrentTheme.PLAY_ICON, 'Play', self)
        self.playPauseAction.setStatusTip('Play/Pause the animation')
        self.addAction(self.playPauseAction)
        self.connect(self.playPauseAction, QtCore.SIGNAL('triggered(bool)'),
                     self.playPauseTriggered)
        
        self.stopAction = QtGui.QAction(CurrentTheme.STOP_ICON, 'Stop', self)
        self.stopAction.setStatusTip('Stop the animation')
        self.addAction(self.stopAction)
        self.connect(self.stopAction, QtCore.SIGNAL('triggered(bool)'),
                     self.stop)
        
        self.playerTimer = QtCore.QTimer()
        self.playerTimer.setSingleShot(True)
        self.connect(self.playerTimer, QtCore.SIGNAL('timeout()'),
                     self.playNextVersion)

        self.speedGroup = QtGui.QActionGroup(self)
        self.slowAction = QtGui.QAction('Slow', self)
        self.slowAction.setCheckable(True)
        self.speedGroup.addAction(self.slowAction)
        self.mediumAction = QtGui.QAction('Medium', self)
        self.mediumAction.setCheckable(True)
        self.speedGroup.addAction(self.mediumAction)
        self.fastAction = QtGui.QAction('Fast', self)
        self.fastAction.setCheckable(True)
        self.speedGroup.addAction(self.fastAction)
        self.speedGroup.setExclusive(True)
        speed = int(CaptureAPI.getPreference('VisTrailsPlaybackSpeed'))
        if speed == 0:
            self.slowAction.setChecked(True)
        elif speed == 1:
            self.mediumAction.setChecked(True)
        else:
            self.fastAction.setChecked(True)

        self.speedMenu = QtGui.QMenu()
        self.speedMenu.addAction(self.slowAction)
        self.speedMenu.addAction(self.mediumAction)
        self.speedMenu.addAction(self.fastAction)
        self.speedAction = QtGui.QToolButton(self)
        self.speedAction.setIcon(CurrentTheme.SPEED_ICON)
        self.speedAction.setToolTip('Speed')
        self.speedAction.setStatusTip('Change the playback speed')
        self.speedAction.setPopupMode(QtGui.QToolButton.InstantPopup)
        self.speedAction.setMenu(self.speedMenu)
        self.addWidget(self.speedAction)
        
        self.connect(self.slowAction, QtCore.SIGNAL('triggered(bool)'),
                     self.setSpeed)
        self.connect(self.mediumAction, QtCore.SIGNAL('triggered(bool)'),
                     self.setSpeed)
        self.connect(self.fastAction, QtCore.SIGNAL('triggered(bool)'),
                     self.setSpeed)

        self.addSeparator()

        # Pick Start/Stop Buttons
        
        self.pickAction = QtGui.QAction(CurrentTheme.PICK_VERSIONS_ICON,
                                        'Select versions', self)
        self.pickAction.setStatusTip('Select start and end versions')
        self.pickAction.setCheckable(False)
        self.addAction(self.pickAction)        
        self.connect(self.pickAction, QtCore.SIGNAL('triggered(bool)'),
                     self.pickingTriggered)

        self.addSeparator()
        
        # Frame Slider
        self.frameSlider = QtGui.QSlider(self)
        self.frameSlider.setOrientation(QtCore.Qt.Horizontal)
        self.frameSlider.setMinimum(0)
        self.frameSlider.setMaximum(0)
        self.frameSlider.setSingleStep(1)
        self.addWidget(self.frameSlider)
        self.addSeparator()
        self.frameLabel = QtGui.QLabel(self)
        self.frameLabel.setMinimumWidth(30)
        self.addWidget(self.frameLabel)
        self.connect(self.frameSlider, QtCore.SIGNAL('valueChanged(int)'),
                     self.sliderChanged)
        self.connect(self.frameSlider, QtCore.SIGNAL('sliderMoved(int)'),
                     self.updateFrameSlider)
        self.connect(self.frameSlider, QtCore.SIGNAL('sliderReleased()'),
                     self.updateFrameContent)

        # Set the view toggle icon
        tva = self.toggleViewAction()
        tva.setIcon(CurrentTheme.PLAY_ICON)
        tva.setToolTip('Playback')
        tva.setStatusTip('Playback the changes from one version to another')
        tva.setShortcut('Ctrl+P')

        # Default version
        self.frames = []
        self.currentFrame = 0
        self.opsMap = {}
        self.lastVersion = -1

        self.setCurrentFrame(0)

        self.previousVersions = (-1, -1)
コード例 #26
0
 def saveWindowPreferences(self):
     """ Save the current window settings """
     CaptureAPI.setPreference('VisTrailsBuilderWindowGeometry',
                              self.saveGeometry().toBase64().data())
コード例 #27
0
    def __init__(self, parent=None):
        QBuilderWindow.__init__(self, parent)
        self.descriptionWidget = QtGui.QLabel()
        self.progressLabel = QtGui.QLabel()
        self.progressLabel.setMaximumWidth(80)
        self.progressLabel.setMinimumWidth(80)
        self.progressWidget = QtGui.QProgressBar()
        self.progressWidget.setRange(0,100)
        self.statusBar().addWidget(self.descriptionWidget,1)
        self.statusBar().addWidget(self.progressLabel,1)
        self.statusBar().addWidget(self.progressWidget,1)
        self.statusWarning = None
        self.descriptionWidget.hide()
        self.progressLabel.hide()
        self.progressWidget.hide()

        self.title = CaptureAPI.getPluginTitle()
        self.setWindowTitle(self.title)
        self.setWindowIcon(CurrentTheme.APPLICATION_ICON)
        #self.modulePalette.toolWindow().destroy()
        self.updateApp = False
        self.timeStatsWindow = None

        if core.system.systemType in ['Darwin']:
            self.menuBar().setAttribute(QtCore.Qt.WA_MacSmallSize)
            self.menuBar().setAttribute(QtCore.Qt.WA_MacMetalStyle)

        self.searchToolBar = QSearchToolBar(self)
        self.addToolBar(QtCore.Qt.BottomToolBarArea, self.searchToolBar)

        self.addToolBarBreak(QtCore.Qt.BottomToolBarArea)

        self.playbackToolBar = QPlaybackToolBar(self)
        self.addToolBar(QtCore.Qt.BottomToolBarArea, self.playbackToolBar)

        self.addonToolBar.addAction(self.keepViewAction)
        self.addonToolBar.addAction(self.searchToolBar.toggleViewAction())
        self.addonToolBar.addAction(self.playbackToolBar.toggleViewAction())

        self.toolsMenu.addSeparator()
        self.toolsMenu.addAction(self.searchToolBar.toggleViewAction())
        self.toolsMenu.addAction(self.playbackToolBar.toggleViewAction())

        self.interactionToolBar._selectCursorAction.setToolTip('Select')
        self.interactionToolBar._selectCursorAction.setStatusTip('Select versions and edit the tree view')
        self.interactionToolBar._panCursorAction.setToolTip('Pan')
        self.interactionToolBar._panCursorAction.setStatusTip('Pan the tree view (Shift + Click)')
        self.interactionToolBar._zoomCursorAction.setToolTip('Zoom')
        self.interactionToolBar._zoomCursorAction.setStatusTip('Zoom the tree view (Ctrl + Click)')

        self.connect(self.viewManager,
                     QtCore.SIGNAL('currentVistrailChanged'),
                     self.updateAddonToolBar)

        geometry = CaptureAPI.getPreference('VisTrailsBuilderWindowGeometry')
        if geometry!='':
            self.restoreGeometry(QtCore.QByteArray.fromBase64(QtCore.QByteArray(geometry)))
            desktop = QtGui.QDesktopWidget()
            if desktop.screenNumber(self)==-1:
                self.move(desktop.screenGeometry().topLeft())

        alwaysOnTop = int(CaptureAPI.getPreference('VisTrailsAlwaysOnTop'))
        if alwaysOnTop:
            self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
コード例 #28
0
    def showAboutMessage(self):
        """showAboutMessage() -> None
        Displays Application about message

        """
        QtGui.QMessageBox.about(self, 'About Provenance Explorer', CaptureAPI.getAboutString())
コード例 #29
0
ファイル: patch.py プロジェクト: gzt200361/ThirdParty-2.0.0
 def prepareVisTrails(cls):
     """ Disable tracking """
     CaptureAPI.setAppTracking(int(False))
コード例 #30
0
ファイル: patch.py プロジェクト: gzt200361/ThirdParty-2.0.0
 def restoreVisTrails(cls):
     """ Enable back reporting """
     CaptureAPI.setAppTracking(int(True))