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:
parent
9dadba61c4
commit
25a6da8a99
|
@ -336,7 +336,7 @@ class Config(object):
|
|||
def add_layout(self, name, layout):
|
||||
"""Add a new layout"""
|
||||
return(self.base.add_layout(name, layout))
|
||||
|
||||
|
||||
def replace_layout(self, name, layout):
|
||||
"""Replace an existing layout"""
|
||||
return(self.base.replace_layout(name, layout))
|
||||
|
|
|
@ -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()
|
||||
|
@ -1142,9 +1147,10 @@ class PrefsEditor:
|
|||
selected = treeview.get_selection()
|
||||
(model, rowiter) = selected.get_selected()
|
||||
name = model.get_value(rowiter, 0)
|
||||
|
||||
|
||||
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"""
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue