From b0f5ab21b9f57c0227c49967e0f30cd4fbb1df49 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 21 Aug 2011 00:38:50 +0100 Subject: [PATCH] Layouts with more than two tabs would fail to load. Fixes LP #646826 --- terminatorlib/notebook.py | 3 +++ terminatorlib/window.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 3b2e653e..748fdea7 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -105,6 +105,7 @@ class Notebook(Container, gtk.Notebook): def split_axis(self, widget, vertical=True, cwd=None, sibling=None, widgetfirst=True): """Split the axis of a terminal inside us""" + dbg('called for widget: %s' % widget) order = None page_num = self.page_num(widget) if page_num == -1: @@ -143,6 +144,7 @@ class Notebook(Container, gtk.Notebook): def add(self, widget): """Add a widget to the container""" + dbg('adding a new tab') self.newtab(widget=widget) def remove(self, widget): @@ -172,6 +174,7 @@ class Notebook(Container, gtk.Notebook): def newtab(self, debugtab=False, widget=None, cwd=None): """Add a new tab, optionally supplying a child widget""" + dbg('making a new tab') maker = Factory() top_window = self.get_toplevel() diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 94f59e47..b7a6f3d7 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -228,6 +228,7 @@ class Window(Container, gtk.Window): cwd = widget.get_cwd() maker = Factory() if not self.is_child_notebook(): + dbg('Making a new Notebook') notebook = maker.make('Notebook', window=self) self.get_child().newtab(debugtab, cwd=cwd) @@ -770,6 +771,10 @@ class Window(Container, gtk.Window): self.split_axis(terminal, False) elif child['type'] == 'Notebook': self.tab_new() + i = 2 + while i < len(child['children']): + self.tab_new() + i = i + 1 elif child['type'] == 'Terminal': pass else: