tabs were previously being created in the wrong sorted order. Fixes LP#615930
This commit is contained in:
parent
b0f5ab21b9
commit
aadeb45dc3
@ -61,6 +61,17 @@ class Notebook(Container, gtk.Notebook):
|
|||||||
|
|
||||||
def create_layout(self, layout):
|
def create_layout(self, layout):
|
||||||
"""Apply layout configuration"""
|
"""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'):
|
if not layout.has_key('children'):
|
||||||
err('layout specifies no children: %s' % layout)
|
err('layout specifies no children: %s' % layout)
|
||||||
return
|
return
|
||||||
@ -73,13 +84,13 @@ class Notebook(Container, gtk.Notebook):
|
|||||||
|
|
||||||
num = 0
|
num = 0
|
||||||
keys = children.keys()
|
keys = children.keys()
|
||||||
keys.sort()
|
keys.sort(child_compare)
|
||||||
|
|
||||||
for child_key in keys:
|
for child_key in keys:
|
||||||
child = children[child_key]
|
child = children[child_key]
|
||||||
dbg('Making a child of type: %s' % child['type'])
|
dbg('Making a child of type: %s' % child['type'])
|
||||||
if child['type'] == 'Terminal':
|
if child['type'] == 'Terminal':
|
||||||
continue
|
pass
|
||||||
elif child['type'] == 'VPaned':
|
elif child['type'] == 'VPaned':
|
||||||
page = self.get_nth_page(num)
|
page = self.get_nth_page(num)
|
||||||
self.split_axis(page, True)
|
self.split_axis(page, True)
|
||||||
|
Loading…
Reference in New Issue
Block a user