Commits

Yuya Nishihara committed 52da10e

graft: remember autoresolve check if not specified by hgrc file

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

  • Participants
  • Parent commits ce2c66c

Comments (0)

Files changed (1)

File tortoisehg/hgqt/graft.py

 
         self.autoresolvechk = QCheckBox(_('Automatically resolve merge '
                                           'conflicts where possible'))
-        self.autoresolvechk.setChecked(
-            self.repo.ui.configbool('tortoisehg', 'autoresolve', False))
         self.layout().addWidget(self.autoresolvechk)
 
         self._cmdlog = cmdui.LogWidget(self)
         self.setMaximumHeight(800)
         self.resize(0, 340)
         self.setWindowTitle(_('Graft - %s') % repoagent.displayName())
+        self._readSettings()
 
     @property
     def repo(self):
         return self._repoagent.rawRepo()
 
+    def _readSettings(self):
+        qs = QSettings()
+        qs.beginGroup('graft')
+        self.autoresolvechk.setChecked(
+            self.repo.ui.configbool('tortoisehg', 'autoresolve',
+                                    qs.value('autoresolve').toBool()))
+        qs.endGroup()
+
+    def _writeSettings(self):
+        qs = QSettings()
+        qs.beginGroup('graft')
+        qs.setValue('autoresolve', self.autoresolvechk.isChecked())
+        qs.endGroup()
+
     def _updateSourceTitle(self, idx):
         numrevs = len(self.sourcelist)
         if numrevs <= 1:
                                         labels=labels, parent=self):
                 return
         super(GraftDialog, self).reject()
+
+    def done(self, r):
+        self._writeSettings()
+        super(GraftDialog, self).done(r)