Preselect the current layout when opening Prefs window, and also save config after using the layout 'Save' button (Steve Boddy)

This commit is contained in:
Stephen Boddy 2015-07-14 23:09:05 +02:00
parent 9dadba61c4
commit 25a6da8a99
3 changed files with 12 additions and 3 deletions

View File

@ -330,7 +330,12 @@ class PrefsEditor:
self.layoutiters[layout] = liststore.append([layout, editable])
selection = widget.get_selection()
selection.connect('changed', self.on_layout_selection_changed)
selection.select_iter(self.layoutiters['default'])
terminator = Terminator()
if terminator.layoutname:
layout_to_highlight = terminator.layoutname
else:
layout_to_highlight = 'default'
selection.select_iter(self.layoutiters[layout_to_highlight])
# Now set up the selection changed handler for the layout itself
widget = guiget('LayoutTreeView')
selection = widget.get_selection()
@ -1145,6 +1150,7 @@ class PrefsEditor:
if self.config.replace_layout(name, current_layout):
treeview.set_cursor(model.get_path(rowiter), focus_column=treeview.get_column(0), start_editing=False)
self.config.save()
def on_layoutremovebutton_clicked(self, _button):
"""Remove a layout from the list"""

View File

@ -34,6 +34,7 @@ class Terminator(Borg):
debug_address = None
doing_layout = None
layoutname = None
last_active_window = None
groupsend = None
@ -288,6 +289,8 @@ class Terminator(Borg):
window.set_fullscreen(window.isfullscreen)
window.create_layout(layout[windef])
self.layoutname = layoutname
def layout_done(self):
"""Layout operations have finished, record that fact"""
self.doing_layout = False