Yuya Nishihara  committed 0a40b13

merge: move initial focus to Next button (fixes #1868)

Instead of connecting to completeChanged signal, it adds refreshFinished
signal in order to avoid unexpected focus changes.

  • Participants
  • Parent commits 1d9f349
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

         self.setOption(QWizard.IndependentPages, True)
         # set pages
-        self.addPage(SummaryPage(repo, self))
+        summarypage = SummaryPage(repo, self)
+        self.addPage(summarypage)
         self.addPage(MergePage(repo, self))
         self.addPage(CommitPage(repo, self))
         self.addPage(ResultPage(repo, self))
+        # move focus to "Next" button so that "Cancel" doesn't eat Enter key
+        summarypage.refreshFinished.connect(
+            self.button(QWizard.NextButton).setFocus)
         self.resize(QSize(700, 489).expandedTo(self.minimumSizeHint()))
         return True
 class SummaryPage(BasePage):
+    refreshFinished = pyqtSignal()
     def __init__(self, repo, parent):
         super(SummaryPage, self).__init__(repo, parent)
             self.groups.set_visible(False, 'merged')
             self.wd_status.set_status(_('Clean', 'working dir state'), True)
+        self.refreshFinished.emit()
     def onLinkActivated(self, cmd):