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)
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()
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)
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)