Mercurial > libervia-backend
diff frontends/src/primitivus/xmlui.py @ 1367:f71a0fc26886
merged branch frontends_multi_profiles
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 18 Mar 2015 10:52:28 +0100 (2015-03-18) |
parents | e3a9ea76de35 |
children | 069ad98b360d |
line wrap: on
line diff
--- a/frontends/src/primitivus/xmlui.py Thu Feb 05 11:59:26 2015 +0100 +++ b/frontends/src/primitivus/xmlui.py Wed Mar 18 10:52:28 2015 +0100 @@ -26,6 +26,7 @@ from sat.core.log import getLogger log = getLogger(__name__) from sat_frontends.primitivus.constants import Const as C +from sat_frontends.primitivus.widget import PrimitivusWidget from sat_frontends.tools import xmlui @@ -355,14 +356,14 @@ return cls -class XMLUIPanel(xmlui.XMLUIPanel, urwid.WidgetWrap): +class XMLUIPanel(xmlui.XMLUIPanel, PrimitivusWidget): widget_factory = WidgetFactory() - def __init__(self, host, parsed_xml, title = None, flags = None): + def __init__(self, host, parsed_xml, title=None, flags=None, callback=None, profile=C.PROF_KEY_NONE): self.widget_factory._xmlui_main = self self._dest = None - xmlui.XMLUIPanel.__init__(self, host, parsed_xml, title, flags) - urwid.WidgetWrap.__init__(self, self.main_cont) + xmlui.XMLUIPanel.__init__(self, host, parsed_xml, title, flags, callback, profile) + PrimitivusWidget.__init__(self, self.main_cont, self.xmlui_title) def constructUI(self, parsed_dom): def postTreat(): @@ -412,11 +413,10 @@ raise ValueError('Invalid show_type [%s]' % show_type) self._dest = show_type - decorated = sat_widgets.LabelLine(self, sat_widgets.SurroundedText(self.title or '')) if show_type == 'popup': - self.host.showPopUp(decorated, valign=valign) + self.host.showPopUp(self, valign=valign) elif show_type == 'window': - self.host.addWindow(decorated) + self.host.newWidget(self) else: assert(False) self.host.redraw()