Edit new profiles/layouts as they are created. Partly because the default names suck, but partly to clearly hint that they are editable

This commit is contained in:
Chris Jones 2010-02-08 21:03:43 +00:00
parent ad5c927d15
commit 79381c61d0
1 changed files with 10 additions and 2 deletions

View File

@ -652,7 +652,11 @@ class PrefsEditor:
newprofile = '%s %d' % (_('New Profile'), i)
if self.config.add_profile(newprofile):
model.append([newprofile, True])
res = model.append([newprofile, True])
if res:
path = model.get_path(res)
treeview.set_cursor(path, focus_column=treeview.get_column(0),
start_editing=True)
def on_profileremovebutton_clicked(self, _button):
"""Remove a profile from the list"""
@ -690,7 +694,11 @@ class PrefsEditor:
name = '%s %d' % (_('New Layout'), i)
if self.config.add_layout(name, current_layout):
model.append([name, True])
res = model.append([name, True])
if res:
path = model.get_path(res)
treeview.set_cursor(path, focus_column=treeview.get_column(0),
start_editing=True)
def on_layoutremovebutton_clicked(self, _button):
"""Remove a layout from the list"""