Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

cmdui: add finishfunc param for Dialog

Changeset a0e06cb080f0

Parent 4afb58d4d308

by Adrian Buehlmann

Changes to one file · Browse files at a0e06cb080f0 Showing diff from parent 4afb58d4d308 Diff from another changeset...

 
255
256
257
258
 
259
260
261
 
 
262
263
264
 
340
341
342
 
 
343
344
345
 
255
256
257
 
258
259
260
261
262
263
264
265
266
 
342
343
344
345
346
347
348
349
@@ -255,10 +255,12 @@
  commandFinished = pyqtSignal(thread.DataWrapper)   commandCanceling = pyqtSignal()   - def __init__(self, cmdline, parent=None): + def __init__(self, cmdline, parent=None, finishfunc=None):   super(Dialog, self).__init__(parent)   self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)   + self.finishfunc = finishfunc +   self.core = Core()   self.core.commandFinished.connect(self.command_finished)   self.core.commandCanceling.connect(lambda: self.commandCanceling.emit()) @@ -340,6 +342,8 @@
  self.cancel_btn.setHidden(True)   self.close_btn.setShown(True)   self.close_btn.setFocus() + if self.finishfunc: + self.finishfunc()     def command_canceling(self):   self.cancel_btn.setDisabled(True)