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

thgconfig: add an 'ok' button, use all stock buttons

Changeset 4540bcf71bbc

Parent 9b947bdf4a98

by Steve Borho

Changes to one file · Browse files at 4540bcf71bbc Showing diff from parent 9b947bdf4a98 Diff from another changeset...

 
516
517
518
519
 
 
 
520
 
521
522
523
 
573
574
575
576
577
578
579
580
581
582
 
695
696
697
698
 
 
 
 
 
699
700
 
 
 
 
701
702
703
704
705
706
 
 
707
708
709
 
516
517
518
 
519
520
521
522
523
524
525
526
 
576
577
578
 
 
 
 
579
580
581
 
694
695
696
 
697
698
699
700
701
702
 
703
704
705
706
707
708
709
710
 
 
711
712
713
714
715
@@ -516,8 +516,11 @@
  def __init__(self, configrepo=False):   """ Initialize the Dialog. """   gtk.Dialog.__init__(self, parent=None, flags=0, - buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)) + buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE, + gtk.STOCK_APPLY, gtk.RESPONSE_APPLY, + gtk.STOCK_OK, gtk.RESPONSE_OK))   gtklib.set_tortoise_keys(self) + self._btn_apply = self.action_area.get_children()[1]     self.ui = ui.ui()   try: @@ -573,10 +576,6 @@
  self.show_tabs = True   self.show_border = True   - self._btn_apply = gtk.Button(_('Apply')) - self._btn_apply.connect('clicked', self._apply_clicked) - self.action_area.pack_end(self._btn_apply) -   self.dirty = False   self.pages = []   self.tooltips = gtk.Tooltips() @@ -695,15 +694,22 @@
  def delete_event(self, dlg, event):   return True   - def should_live(self, *args): + def should_live(self, dialog=None, resp=None): + if resp == gtk.RESPONSE_APPLY: + self._apply_clicked() + self.emit_stop_by_name('response') + return True   if self.dirty and not self.readonly: - ret = gdialog.CustomPrompt(_('Confirm Exit'), + if resp == gtk.RESPONSE_OK: + ret = 0 + else: + ret = gdialog.CustomPrompt(_('Confirm Exit'),   _("Exit after saving changes?"), self,   (_('&Yes'), _('&No (discard changes)'),   _('&Cancel')), default=2, esc=2).run()   if ret == 2: - if len(args) != 0: - self.emit_stop_by_name('response') + if resp is not None: + self.emit_stop_by_name('response')   return True   elif ret == 0:   self._apply_clicked()