diff frontends/src/tools/xmlui.py @ 1486:a77217511afd

tools, frontends (xmlui): allow to select a tab when adding it
author souliane <souliane@mailoo.org>
date Fri, 21 Aug 2015 14:17:41 +0200
parents 90130847a0a8
children 039d96e131be
line wrap: on
line diff
--- a/frontends/src/tools/xmlui.py	Fri Aug 21 19:23:14 2015 +0200
+++ b/frontends/src/tools/xmlui.py	Fri Aug 21 14:17:41 2015 +0200
@@ -374,12 +374,13 @@
             elif node.nodeName == 'tab':
                 name = node.getAttribute('name')
                 label = node.getAttribute('label')
+                selected = C.bool(node.getAttribute('selected') or C.BOOL_FALSE)
                 if not name or not isinstance(data, TabsContainer):
                     raise InvalidXMLUI
                 if self.type == 'param':
                     self._current_category = name #XXX: awful hack because params need category and we don't keep parent
                 tab_cont = data
-                new_tab = tab_cont._xmluiAddTab(label or name)
+                new_tab = tab_cont._xmluiAddTab(label or name, selected)
                 self._parseChilds(new_tab, node, ('widget', 'container'))
 
             elif node.nodeName == 'row':