Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
1485:9fcc16ef163a | 1486:a77217511afd |
---|---|
372 raise Exception(_("Internal Error, container has not _xmluiAppend method")) | 372 raise Exception(_("Internal Error, container has not _xmluiAppend method")) |
373 | 373 |
374 elif node.nodeName == 'tab': | 374 elif node.nodeName == 'tab': |
375 name = node.getAttribute('name') | 375 name = node.getAttribute('name') |
376 label = node.getAttribute('label') | 376 label = node.getAttribute('label') |
377 selected = C.bool(node.getAttribute('selected') or C.BOOL_FALSE) | |
377 if not name or not isinstance(data, TabsContainer): | 378 if not name or not isinstance(data, TabsContainer): |
378 raise InvalidXMLUI | 379 raise InvalidXMLUI |
379 if self.type == 'param': | 380 if self.type == 'param': |
380 self._current_category = name #XXX: awful hack because params need category and we don't keep parent | 381 self._current_category = name #XXX: awful hack because params need category and we don't keep parent |
381 tab_cont = data | 382 tab_cont = data |
382 new_tab = tab_cont._xmluiAddTab(label or name) | 383 new_tab = tab_cont._xmluiAddTab(label or name, selected) |
383 self._parseChilds(new_tab, node, ('widget', 'container')) | 384 self._parseChilds(new_tab, node, ('widget', 'container')) |
384 | 385 |
385 elif node.nodeName == 'row': | 386 elif node.nodeName == 'row': |
386 try: | 387 try: |
387 index = str(data['index']) | 388 index = str(data['index']) |