Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable merge: Disable the NextButton ("Merge"/"Commit") when the action in process.

It seems like setting one of the Wizard buttons to "hidden" doesn't really work,
I suspect this is because QWizard will make sure it is visible when it handles
isComplete().
Also this avoids recreating the NextButton when we only need to set the text.

Changeset 48b039111490

Parent a392e92938c3

by Daniel Atallah

Changes to one file · Browse files at 48b039111490 Showing diff from parent a392e92938c3 Diff from another changeset...

 
74
75
76
77
 
78
79
80
 
154
155
156
157
158
159
 
 
 
 
160
161
162
 
165
166
167
168
 
169
170
171
 
399
400
401
 
 
402
403
404
 
538
539
540
541
542
543
544
 
667
668
669
 
 
670
671
672
 
74
75
76
 
77
78
79
80
 
154
155
156
 
 
 
157
158
159
160
161
162
163
 
166
167
168
 
169
170
171
172
 
400
401
402
403
404
405
406
407
 
541
542
543
 
544
545
546
 
669
670
671
672
673
674
675
676
@@ -74,7 +74,7 @@
    def __init__(self, parent=None):   super(BasePage, self).__init__(parent) - + self.nextEnabled = True   self.done = False     def switch_pane(self, pane): @@ -154,9 +154,10 @@
  if pane == MAIN_PANE:   label = self.get_perform_label()   if label: - btn = QPushButton(label) - self.wizard().setButton(QWizard.NextButton, btn) - self.wizard().button(QWizard.NextButton).setShown(True) + self.wizard().setButtonText(QWizard.NextButton, label); + self.nextEnabled = True + else: + self.nextEnabled = False   self.wizard().setOption(QWizard.HaveHelpButton, False)   self.wizard().setOption(QWizard.HaveCustomButton1, False)   self.wizard().setOption(QWizard.NoCancelButton, False) @@ -165,7 +166,7 @@
  self.wizard().setButton(QWizard.CustomButton1, button)   self.wizard().setOption(QWizard.HaveCustomButton1, True)   button.clicked.connect(self.cancel_clicked) - self.wizard().button(QWizard.NextButton).setHidden(True) + self.nextEnabled = False   self.wizard().setOption(QWizard.NoCancelButton, True)   else:   raise 'unknown pane: %s' % pane @@ -399,6 +400,8 @@
  self.cmd.cancel()     def isComplete(self): + if not self.nextEnabled: + return False   if self.clean:   return True   return self.field('force').toBool() @@ -538,7 +541,6 @@
    def __init__(self, parent=None):   super(CommitPage, self).__init__(parent) - self.done = False     ### Override Methods ###   @@ -667,6 +669,8 @@
  self.cmd.run(cmdline)     def isComplete(self): + if not self.nextEnabled: + return False   repo = self.wizard().repo   for root, path, status in thgrepo.recursiveMergeStatus(repo):   if status == 'u':