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

cmdui: close Dialog with Accepted if command finished successfully

This provides the command result to the caller::

dialog = cmdui.Dialog(...)
if dialog.exec_():
# success
else:
# failure

We override reject() instead of adding new function, e.g. close_clicked(),
because reject() is called if escape key pressed.

Changeset e484a3d6d893

Parent 027091452719

by Yuya Nishihara

Changes to one file · Browse files at e484a3d6d893 Showing diff from parent 027091452719 Diff from another changeset...

 
299
300
301
302
 
 
 
 
303
304
305
 
299
300
301
 
302
303
304
305
306
307
308
@@ -299,7 +299,10 @@
  return     # close dialog - QDialog.reject(self) + if self.core.thread.ret == 0: + self.accept() # means command successfully finished + else: + super(Dialog, self).reject()     ### Signal Handlers ###