Changeset 02a18814dc87…
Parent 0e6c681c0146…
by
Changes to one file · Browse files at 02a18814dc87 Showing diff from parent 0e6c681c0146 Diff from another changeset...
@@ -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
|
Loading...