Layouts with more than two tabs would fail to load. Fixes LP #646826
This commit is contained in:
parent
9fc2115699
commit
b0f5ab21b9
@ -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()
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user