Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

commit: add 'cancel' button to confirm dialog on exit

Changeset da16cd2c7ed8

Parent 9060aa45512e

by Yuki KODAMA

Changes to one file · Browse files at da16cd2c7ed8 Showing diff from parent 9060aa45512e Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​commit.py Stacked
 
300
301
302
303
304
305
306
 
 
 
 
 
307
308
309
310
 
311
312
313
 
300
301
302
 
 
 
 
303
304
305
306
307
308
309
310
 
311
312
313
314
@@ -300,14 +300,15 @@
  live = False   buf = self.text.get_buffer()   if buf.get_char_count() > 10 and buf.get_modified(): - dialog = gdialog.Confirm(_('Confirm Exit'), [], self, - _('Save commit message at exit?')) - res = dialog.run() - if res == gtk.RESPONSE_YES: + # response: 0=Yes, 1=No, 2=Cancel + response = gdialog.CustomPrompt(_('Confirm Exit'), + _('Save commit message at exit?'), self, + (_('&Yes'), _('&No'), _('&Cancel')), 2, 2).run() + if response == 0:   begin, end = buf.get_bounds()   self.update_recent_messages(buf.get_text(begin, end))   buf.set_modified(False) - elif res != gtk.RESPONSE_NO: + elif response == 2:   live = True   if not live:   self._destroying(widget)