From 79381c61d0314456c9e59b4232eb8127f49f0db3 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 8 Feb 2010 21:03:43 +0000 Subject: [PATCH] Edit new profiles/layouts as they are created. Partly because the default names suck, but partly to clearly hint that they are editable --- terminatorlib/prefseditor.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 20f691c7..080a0b04 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -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"""