Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8.1, 0.8.2, and 0.8.3

commit: prevent unexpected clearing by ESC key

This fix prevents unexpected clearing by ESC key. I changed to
2 buttons style. To apply changes, the user have to push 'OK'.
'Close' will cause misunderstanding.

Changeset bd57bc651e51

Parent a325afde6ba9

by Yuki KODAMA

Changes to one file · Browse files at bd57bc651e51 Showing diff from parent a325afde6ba9 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​commit.py Stacked
 
27
28
29
30
 
 
31
32
33
 
57
58
59
 
60
61
62
 
63
64
65
 
69
70
71
72
73
74
75
76
77
78
 
 
 
 
 
 
 
 
79
80
81
 
27
28
29
 
30
31
32
33
34
 
58
59
60
61
62
63
64
65
66
67
68
 
72
73
74
 
 
 
 
 
 
 
75
76
77
78
79
80
81
82
83
84
85
@@ -27,7 +27,8 @@
 class BranchOperationDialog(gtk.Dialog):   def __init__(self, branch, close):   gtk.Dialog.__init__(self, parent=None, flags=gtk.DIALOG_MODAL, - buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) + buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, + gtk.STOCK_OK, gtk.RESPONSE_OK))   gtklib.set_tortoise_keys(self)   self.connect('response', self.response)   self.set_title(_('Branch Operations')) @@ -57,9 +58,11 @@
    self.newbranchradio.set_active(True)   if branch: + self.newbranch = branch   self.branchentry.set_text(branch)   self.newbranchradio.set_active(True)   elif close: + self.closebranch = close   self.closebranchradio.set_active(True)   else:   nochanges.set_active(True) @@ -69,13 +72,14 @@
  self.branchentry.set_sensitive(radio.get_active())     def response(self, widget, response_id): - if response_id != gtk.RESPONSE_CLOSE: - self.destroy() - return - if self.newbranchradio.get_active(): - self.newbranch = self.branchentry.get_text() - elif self.closebranchradio.get_active(): - self.closebranch = True + if response_id == gtk.RESPONSE_OK: + if self.newbranchradio.get_active(): + self.newbranch = self.branchentry.get_text() + elif self.closebranchradio.get_active(): + self.closebranch = True + else: + self.newbranch = None + self.closebranch = False   self.destroy()