tabs were previously being created in the wrong sorted order. Fixes LP#615930

This commit is contained in:
Chris Jones 2011-08-21 01:01:59 +01:00
parent b0f5ab21b9
commit aadeb45dc3
1 changed files with 13 additions and 2 deletions

View File

@ -61,6 +61,17 @@ class Notebook(Container, gtk.Notebook):
def create_layout(self, layout):
"""Apply layout configuration"""
def child_compare(a, b):
order_a = children[a]['order']
order_b = children[b]['order']
if (order_a == order_b):
return 0
if (order_a < order_b):
return -1
if (order_a > order_b):
return 1
if not layout.has_key('children'):
err('layout specifies no children: %s' % layout)
return
@ -73,13 +84,13 @@ class Notebook(Container, gtk.Notebook):
num = 0
keys = children.keys()
keys.sort()
keys.sort(child_compare)
for child_key in keys:
child = children[child_key]
dbg('Making a child of type: %s' % child['type'])
if child['type'] == 'Terminal':
continue
pass
elif child['type'] == 'VPaned':
page = self.get_nth_page(num)
self.split_axis(page, True)