From bba9e2237a6d90273ef180c6f439f0a69cd38f6a Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Sun, 19 Feb 2017 16:57:36 +0100 Subject: [PATCH] Remove auto-capitalisation of profiles in menu, add sorting, and fix exception when adding new one in prefs --- terminatorlib/prefseditor.py | 2 +- terminatorlib/terminal_popup_menu.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index e0b5e989..e93fc996 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -1144,7 +1144,7 @@ class PrefsEditor: res = model.append([newprofile, True]) if res: path = model.get_path(res) - treeview.set_cursor(path, focus_column=treeview.get_column(0), + treeview.set_cursor(path, column=treeview.get_column(0), start_editing=True) self.layouteditor.update_profiles() diff --git a/terminatorlib/terminal_popup_menu.py b/terminatorlib/terminal_popup_menu.py index 5be2dabf..a1e10b85 100755 --- a/terminatorlib/terminal_popup_menu.py +++ b/terminatorlib/terminal_popup_menu.py @@ -4,6 +4,8 @@ """terminal_popup_menu.py - classes necessary to provide a terminal context menu""" +import string + from gi.repository import Gtk from version import APP_NAME @@ -189,7 +191,7 @@ class TerminalPopupMenu(object): item.connect('activate', lambda x: PrefsEditor(self.terminal)) menu.append(item) - profilelist = self.config.list_profiles() + profilelist = sorted(self.config.list_profiles(), key=string.lower) if len(profilelist) > 1: item = Gtk.MenuItem.new_with_mnemonic(_('Profiles')) @@ -202,7 +204,10 @@ class TerminalPopupMenu(object): group = None for profile in profilelist: - item = Gtk.RadioMenuItem(profile.capitalize(), group) + profile_label = profile + if profile_label == 'default': + profile_label = profile.capitalize() + item = Gtk.RadioMenuItem(profile_label, group) if profile == current: item.set_active(True) item.connect('activate', terminal.force_set_profile, profile)