Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug 971] - Save button throws KeyError when a multiple tab layout is… #972

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions terminatorlib/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, window):

self.show_all()

def configure(self):
def configure(self, clear_last_active_term = True):
"""Apply widget-wide settings"""
# FIXME: The old reordered handler updated Terminator.terminals with
# the new order of terminals. We probably need to preserve this for
Expand All @@ -76,7 +76,14 @@ def configure(self):
# style.xthickness = 0
# style.ythickness = 0
# self.modify_style(style)
self.last_active_term = {}

#when on_closebutton_clicked is called from prefseditor, it reconfigures
#the terminator. if they are cleared then
#self.last_active_term[self.get_nth_page(tabnum)] fails in container.py
#in describe_layout

if clear_last_active_term:
self.last_active_term = {}

def create_window_detach(self, notebook, widget, x, y):
"""Create a window to contain a detached tab"""
Expand Down
2 changes: 1 addition & 1 deletion terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def on_closebutton_clicked(self, _button):
"""Close the window"""
self.config.base.remove_config_with_suffix('_cur')
terminator = Terminator()
terminator.reconfigure()
terminator.reconfigure(clear_last_active_term = False)
self.window.destroy()
self.calling_window.preventHide = False
del(self)
Expand Down
4 changes: 2 additions & 2 deletions terminatorlib/terminator.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def on_gtk_theme_name_notify(self, settings, prop):
self.cur_gtk_theme_name = new_gtk_theme_name
self.reconfigure()

def reconfigure(self):
def reconfigure(self, clear_last_active_term = True):
"""Update configuration for the whole application"""

if self.style_providers != []:
Expand Down Expand Up @@ -505,7 +505,7 @@ def reconfigure(self):
for window in self.windows:
child = window.get_child()
if maker.isinstance(child, 'Notebook'):
child.configure()
child.configure(clear_last_active_term)

def on_css_parsing_error(self, provider, section, error, user_data=None):
"""Report CSS parsing issues"""
Expand Down
Loading