Mercurial > libervia-web
comparison src/browser/sat_browser/xmlui.py @ 679:a90cc8fc9605
merged branch frontends_multi_profiles
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 18 Mar 2015 16:15:18 +0100 |
parents | ebb602d8b3f2 |
children | 9877607c719a |
comparison
equal
deleted
inserted
replaced
590:1bffc4c244c3 | 679:a90cc8fc9605 |
---|---|
69 | 69 |
70 def __init__(self, _xmlui_parent, style='line'): | 70 def __init__(self, _xmlui_parent, style='line'): |
71 """Add a divider | 71 """Add a divider |
72 | 72 |
73 @param _xmlui_parent | 73 @param _xmlui_parent |
74 @param style (string): one of: | 74 @param style (unicode): one of: |
75 - line: a simple line | 75 - line: a simple line |
76 - dot: a line of dots | 76 - dot: a line of dots |
77 - dash: a line of dashes | 77 - dash: a line of dashes |
78 - plain: a full thick line | 78 - plain: a full thick line |
79 - blank: a blank line/space | 79 - blank: a blank line/space |
405 | 405 |
406 | 406 |
407 class XMLUIPanel(LiberviaXMLUIBase, xmlui.XMLUIPanel, VerticalPanel): | 407 class XMLUIPanel(LiberviaXMLUIBase, xmlui.XMLUIPanel, VerticalPanel): |
408 widget_factory = WidgetFactory() | 408 widget_factory = WidgetFactory() |
409 | 409 |
410 def __init__(self, host, parsed_xml, title=None, flags=None): | 410 def __init__(self, host, parsed_xml, title=None, flags=None, callback=None, profile=C.PROF_KEY_NONE): |
411 self.widget_factory._xmlui_main = self | 411 self.widget_factory._xmlui_main = self |
412 VerticalPanel.__init__(self) | 412 VerticalPanel.__init__(self) |
413 self.setSize('100%', '100%') | 413 self.setSize('100%', '100%') |
414 xmlui.XMLUIPanel.__init__(self, host, parsed_xml, title, flags) | 414 xmlui.XMLUIPanel.__init__(self, host, parsed_xml, title, flags, callback, profile) |
415 | 415 |
416 def setCloseCb(self, close_cb): | 416 def setCloseCb(self, close_cb): |
417 self.close_cb = close_cb | 417 self.close_cb = close_cb |
418 | 418 |
419 def _xmluiClose(self): | 419 def _xmluiClose(self): |
443 hpanel.add(Button('Cancel', lambda ignore: self._xmluiClose())) | 443 hpanel.add(Button('Cancel', lambda ignore: self._xmluiClose())) |
444 self.add(hpanel) | 444 self.add(hpanel) |
445 | 445 |
446 def show(self): | 446 def show(self): |
447 options = ['NO_CLOSE'] if self.type == C.XMLUI_FORM else [] | 447 options = ['NO_CLOSE'] if self.type == C.XMLUI_FORM else [] |
448 _dialog = dialog.GenericDialog(self.title, self, options=options) | 448 _dialog = dialog.GenericDialog(self.xmlui_title, self, options=options) |
449 self.setCloseCb(_dialog.close) | 449 self.setCloseCb(_dialog.close) |
450 _dialog.show() | 450 _dialog.show() |
451 | 451 |
452 | 452 |
453 class XMLUIDialog(LiberviaXMLUIBase, xmlui.XMLUIDialog): | 453 class XMLUIDialog(LiberviaXMLUIBase, xmlui.XMLUIDialog): |
454 dialog_factory = GenericFactory() | 454 dialog_factory = GenericFactory() |
455 | 455 |
456 def __init__(self, host, parsed_dom, title = None, flags = None): | 456 def __init__(self, host, parsed_dom, title = None, flags = None, callback=None, profile=C.PROF_KEY_NONE): |
457 xmlui.XMLUIDialog.__init__(self, host, parsed_dom, title, flags) | 457 xmlui.XMLUIDialog.__init__(self, host, parsed_dom, title, flags, callback, profile) |
458 | 458 |
459 xmlui.registerClass(xmlui.CLASS_PANEL, XMLUIPanel) | 459 xmlui.registerClass(xmlui.CLASS_PANEL, XMLUIPanel) |
460 xmlui.registerClass(xmlui.CLASS_DIALOG, XMLUIDialog) | 460 xmlui.registerClass(xmlui.CLASS_DIALOG, XMLUIDialog) |
461 | 461 |
462 def create(*args, **kwargs): | 462 def create(*args, **kwargs): |