Commits

Yuki KODAMA committed d0cbd66

quickop: prevent AttributeError caused by 'self.abortbtn'

Finally, I figured out that 'set_no_show_all()' can not be used to prevent
adding bottom buttons by 'add_button()'. So I had to defer it and add it
in 'after_init()'.

Fixes #888

  • Participants
  • Parent commits eabe6ec
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgtk/quickop.py

         # add dialog buttons
         self.gobutton = self.add_button(labels[command][1], gtk.RESPONSE_OK)
         self.closebtn = self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CLOSE)
+        self.abortbtn = gtk.Button(_('Abort'))
+        self.abortbtn.connect('clicked',
+                      lambda *a: self.response(gtk.RESPONSE_CANCEL))
 
         lbl = gtk.Label(labels[command][0])
         lbl.set_alignment(0, 0)
         self.cmd.hide()
         self.vbox.pack_start(self.cmd, False, False, 6)
 
-        # abort button
-        self.abortbtn = self.add_button(_('Abort'), gtk.RESPONSE_CANCEL)
-        self.abortbtn.hide()
+        # add Abort button
+        self.action_area.add(self.abortbtn)
 
     def abort(self):
         self.cmd.stop()