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

gdialog: prevent AttributeError caused by 'self.abortbtn'

This changeset brings same fix as <d0cbd66e993e> on stable.

Refs #888

Changeset 5e6e5acccfb1

Parent 24f32e4e030b

by Yuki KODAMA

Changes to one file · Browse files at 5e6e5acccfb1 Showing diff from parent 24f32e4e030b Diff from another changeset...

 
775
776
777
778
779
780
781
 
 
782
783
784
 
820
821
822
823
 
824
825
826
827
 
 
 
 
 
 
 
828
829
 
830
831
832
 
775
776
777
 
 
 
 
778
779
780
781
782
 
818
819
820
 
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
@@ -775,10 +775,8 @@
  self.cmd.hide()   self.vbox.pack_start(self.cmd, False, False, 6)   - # abort button - btn = self.add_button(_('Abort'), gtk.RESPONSE_CANCEL) - self.buttons['abort'] = btn - btn.hide() + # add Abort button + self.action_area.add(self.buttons['abort'])     def do_switch_to(self, mode, cmd=True):   if mode == MODE_NORMAL: @@ -820,13 +818,21 @@
  reponame = self.repo and hglib.get_reponame(self.repo) or ''   self.set_title(self.get_title(reponame))   - # construct ui widgets + # add user-defined buttons   self.buttons = {}   for name, label, res in self.get_buttons():   btn = self.add_button(label, res)   self.buttons[name] = btn + + # create Abort button (add later) + btn = gtk.Button(_('Abort')) + btn.connect('clicked', lambda *a: self.response(gtk.RESPONSE_CANCEL)) + self.buttons['abort'] = btn + + # construct dialog body   self.get_body(self.vbox)   + # focus on default button if needs   name = self.get_default_button()   if name:   btn = self.buttons.get(name)