Remove auto-capitalisation of profiles in menu, add sorting, and fix exception when adding new one in prefs
This commit is contained in:
parent
e88f3b2140
commit
bba9e2237a
|
@ -1144,7 +1144,7 @@ class PrefsEditor:
|
||||||
res = model.append([newprofile, True])
|
res = model.append([newprofile, True])
|
||||||
if res:
|
if res:
|
||||||
path = model.get_path(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)
|
start_editing=True)
|
||||||
|
|
||||||
self.layouteditor.update_profiles()
|
self.layouteditor.update_profiles()
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
"""terminal_popup_menu.py - classes necessary to provide a terminal context
|
"""terminal_popup_menu.py - classes necessary to provide a terminal context
|
||||||
menu"""
|
menu"""
|
||||||
|
|
||||||
|
import string
|
||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
from version import APP_NAME
|
from version import APP_NAME
|
||||||
|
@ -189,7 +191,7 @@ class TerminalPopupMenu(object):
|
||||||
item.connect('activate', lambda x: PrefsEditor(self.terminal))
|
item.connect('activate', lambda x: PrefsEditor(self.terminal))
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
profilelist = self.config.list_profiles()
|
profilelist = sorted(self.config.list_profiles(), key=string.lower)
|
||||||
|
|
||||||
if len(profilelist) > 1:
|
if len(profilelist) > 1:
|
||||||
item = Gtk.MenuItem.new_with_mnemonic(_('Profiles'))
|
item = Gtk.MenuItem.new_with_mnemonic(_('Profiles'))
|
||||||
|
@ -202,7 +204,10 @@ class TerminalPopupMenu(object):
|
||||||
group = None
|
group = None
|
||||||
|
|
||||||
for profile in profilelist:
|
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:
|
if profile == current:
|
||||||
item.set_active(True)
|
item.set_active(True)
|
||||||
item.connect('activate', terminal.force_set_profile, profile)
|
item.connect('activate', terminal.force_set_profile, profile)
|
||||||
|
|
Loading…
Reference in New Issue