Commits

Yuya Nishihara committed 2876e7e

rebase: remember autoresolve check if not specified by hgrc file

RebaseDialog can also be finished by "rejected" successfully, so it needs to
write settings on both "accepted" and "rejected".

  • Participants
  • Parent commits 52da10e

Comments (0)

Files changed (1)

tortoisehg/hgqt/rebase.py

 
         self.autoresolvechk = QCheckBox(_('Automatically resolve merge '
                                           'conflicts where possible'))
-        self.autoresolvechk.setChecked(
-            repo.ui.configbool('tortoisehg', 'autoresolve', False))
         self.layout().addWidget(self.autoresolvechk)
 
         self.svnchk = QCheckBox(_('Rebase unpublished onto Subversion head '
         self.setMaximumHeight(800)
         self.resize(0, 340)
         self.setWindowTitle(_('Rebase - %s') % repoagent.displayName())
+        self._readSettings()
 
     @property
     def repo(self):
         return self._repoagent.rawRepo()
 
+    def _readSettings(self):
+        qs = QSettings()
+        qs.beginGroup('rebase')
+        self.autoresolvechk.setChecked(
+            self.repo.ui.configbool('tortoisehg', 'autoresolve',
+                                    qs.value('autoresolve').toBool()))
+        qs.endGroup()
+
+    def _writeSettings(self):
+        qs = QSettings()
+        qs.beginGroup('rebase')
+        qs.setValue('autoresolve', self.autoresolvechk.isChecked())
+        qs.endGroup()
+
     @pyqtSlot(bool)
     def _onCheckFinished(self, clean):
         if not clean:
                                         labels=labels, parent=self):
                 return
         super(RebaseDialog, self).reject()
+
+    def done(self, r):
+        self._writeSettings()
+        super(RebaseDialog, self).done(r)