XMLUI (core, frontends): added JidWidget and DividerWidget + popup type + some bugfixes:
- JidWidget is a text container a Jabber ID, this can be used by frontends for special treatment (e.g.: possibility to click on it)
- DividerWidget is a separator, like a blank or dashed line
- popup type is similar to normal window, but designed for a smaller popping window
This commit is contained in:
parent
9661c1c2c5
commit
edf3e1bc87
1 changed files with 122 additions and 14 deletions
|
|
@ -54,6 +54,21 @@ class TextWidget(Widget):
|
|||
pass
|
||||
|
||||
|
||||
class LabelWidget(Widget):
|
||||
""" Non interactive text """
|
||||
pass
|
||||
|
||||
|
||||
class JidWidget(Widget):
|
||||
""" Jabber ID """
|
||||
pass
|
||||
|
||||
|
||||
class DividerWidget(Widget):
|
||||
""" Separator """
|
||||
pass
|
||||
|
||||
|
||||
class StringWidget(Widget):
|
||||
""" Input widget with require a string
|
||||
often called Edit in toolkits
|
||||
|
|
@ -124,6 +139,7 @@ class AdvancedListContainer(Container):
|
|||
""" Widgets are disposed in rows with advaned features """
|
||||
pass
|
||||
|
||||
|
||||
class XMLUI(object):
|
||||
""" Base class to construct SàT XML User Interface
|
||||
New frontends can inherite this class to easily implement XMLUI
|
||||
|
|
@ -247,7 +263,12 @@ class XMLUI(object):
|
|||
warning (_("text node has no child !"))
|
||||
ctrl = self.widget_factory.createTextWidget(parent, value)
|
||||
elif type_=="label":
|
||||
ctrl = self.widget_factory.createTextWidget(parent, value+": ")
|
||||
ctrl = self.widget_factory.createLabelWidget(parent, value)
|
||||
elif type_=="jid":
|
||||
ctrl = self.widget_factory.createJidWidget(parent, value)
|
||||
elif type_=="divider":
|
||||
style = node.getAttribute("style") or 'line'
|
||||
ctrl = self.widget_factory.createDividerWidget(parent, style)
|
||||
elif type_=="string":
|
||||
ctrl = self.widget_factory.createStringWidget(parent, value)
|
||||
self.ctrl_list[name] = ({'type':type_, 'control':ctrl})
|
||||
|
|
@ -300,7 +321,7 @@ class XMLUI(object):
|
|||
self.title = self.title or top.getAttribute("title") or u""
|
||||
self.session_id = top.getAttribute("session_id") or None
|
||||
self.submit_id = top.getAttribute("submit") or None
|
||||
if top.nodeName != "sat_xmlui" or not self.type in ['form', 'param', 'window']:
|
||||
if top.nodeName != "sat_xmlui" or not self.type in ['form', 'param', 'window', 'popup']:
|
||||
raise InvalidXMLUI
|
||||
|
||||
if self.type == 'param':
|
||||
|
|
|
|||
Loading…
Reference in a new issue