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

clone: introduce a separate cmdfinished signal

using QDialog's finished signal doesn't work, since calling self.accept() will
also close the dialog. But we don't want to close the dialog if the user has
opened the details view during a lengthy clone.

Changeset f1dccd5aae78

Parent 06f8add386cf

by Adrian Buehlmann

Changes to 2 files · Browse files at f1dccd5aae78 Showing diff from parent 06f8add386cf Diff from another changeset...

 
20
21
22
 
 
 
 
23
24
25
 
252
253
254
 
 
 
 
 
255
256
257
 
20
21
22
23
24
25
26
27
28
29
 
256
257
258
259
260
261
262
263
264
265
266
@@ -20,6 +20,10 @@
   class CloneDialog(QDialog):   + cmdfinished = pyqtSignal( + int # status (0: succeeded, -1: failed) + ) +   def __init__(self, args=None, opts={}, parent=None):   super(CloneDialog, self).__init__(parent)   self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) @@ -252,6 +256,11 @@
  self.detail_btn.setShown(True)     def command_finished(self, wrapper): + if wrapper.data is 0: + res = 0 + else: + res = -1 + self.cmdfinished.emit(res)   if wrapper.data is not 0 or self.cmd.is_show_output():   self.detail_btn.setChecked(True)   self.close_btn.setShown(True)
 
199
200
201
202
203
 
 
204
205
206
 
207
208
209
 
199
200
201
 
 
202
203
204
205
 
206
207
208
209
@@ -199,11 +199,11 @@
  return   root = self.selitem.internalPointer().rootpath()   d = CloneDialog(args=[root, root + '-clone'], parent=self) - def finished(res): - if res == QDialog.Accepted: + def cmdfinished(res): + if res == 0:   dest = d.getDest()   self.workbench.openRepo(dest) - d.finished.connect(finished) + d.cmdfinished.connect(cmdfinished)   d.show()    class RepoRegistryView(QDockWidget):