Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

thgconfig: add 'focus' argument to activate specified field

If no specified, it will show 'TortoiseHg' page in default.

Changeset 02a18814dc87

Parent 0e6c681c0146

by Yuki KODAMA

Changes to one file · Browse files at 02a18814dc87 Showing diff from parent 0e6c681c0146 Diff from another changeset...

 
537
538
539
540
 
541
542
543
 
697
698
699
700
701
702
 
 
 
 
 
 
703
704
705
 
1337
1338
1339
1340
1341
1342
 
 
1343
 
537
538
539
 
540
541
542
543
 
697
698
699
 
 
 
700
701
702
703
704
705
706
707
708
 
1340
1341
1342
 
 
 
1343
1344
1345
@@ -537,7 +537,7 @@
  return ret    class ConfigDialog(gtk.Dialog): - def __init__(self, configrepo=False): + def __init__(self, configrepo=False, focus=None):   """ Initialize the Dialog. """   gtk.Dialog.__init__(self, parent=None, flags=0,   buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK, @@ -697,9 +697,12 @@
  self.dirty = False   combo.set_active(configrepo and 1 or 0)   - # activate first config page - self.confview.set_cursor(self.confmodel[0].path) - self.confview.grab_focus() + # focus 'general' page or specified field + if focus: + self.focus_field(focus) + else: + self.show_page('general') + self.confview.grab_focus()     def fileselect(self, combo):   'select another hgrc file' @@ -1337,7 +1340,6 @@
  return 0    def run(ui, *pats, **opts): - dlg = ConfigDialog(opts.get('alias') == 'repoconfig') - if opts.get('focus'): - dlg.focus_field(opts['focus']) + dlg = ConfigDialog(opts.get('alias') == 'repoconfig', + focus=opts.get('focus'))   return dlg