Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0.1, 1.0.2, and 1.0.3

stable thgconfig: restore drop-down list selection on canceled

Also improve confirmation dialog.

Fixes #973

Changeset 26adca060d07

Parent c53595812426

by Yuki KODAMA

Changes to one file · Browse files at 26adca060d07 Showing diff from parent c53595812426 Diff from another changeset...

 
706
707
708
709
710
711
712
 
 
 
 
 
 
 
 
 
 
 
 
713
714
715
 
706
707
708
 
 
 
 
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
@@ -706,10 +706,18 @@
  def fileselect(self, combo):   'select another hgrc file'   if self.dirty: - ret = gdialog.Confirm(_('Unapplied changes'), [], self, - _('Lose changes and switch files?.')).run() - if ret != gtk.RESPONSE_YES: - return + ret = gdialog.CustomPrompt(_('Confirm Switch'), + _('Switch after saving changes?'), self, + (_('&Save'), _('&Discard'), _('&Cancel')), + default=2, esc=2).run() + if ret == 2: + combo.handler_block_by_func(self.fileselect) + repo = combo.get_active() == CONF_GLOBAL + combo.set_active(repo and CONF_REPO or CONF_GLOBAL) + combo.handler_unblock_by_func(self.fileselect) + return + elif ret == 0: + self._apply_clicked()   self.refresh()     def refresh(self):