# HG changeset patch # User Goffi # Date 1439886944 -7200 # Node ID 675e0e9f165323c5edf92c69f7793a7c38614fc5 # Parent c005c212b538df209d32e58515eaec3c3d83c840 core , privmitivus (xmlui): add jidInput handling, with a simple String for now diff -r c005c212b538 -r 675e0e9f1653 frontends/src/primitivus/xmlui.py --- a/frontends/src/primitivus/xmlui.py Tue Aug 18 10:04:47 2015 +0200 +++ b/frontends/src/primitivus/xmlui.py Tue Aug 18 10:35:44 2015 +0200 @@ -102,6 +102,10 @@ return self.get_edit_text() +class PrimitivusJidInputWidget(xmlui.JidInputWidget, PrimitivusStringWidget): + pass + + class PrimitivusPasswordWidget(xmlui.PasswordWidget, sat_widgets.Password, PrimitivusEvents): def __init__(self, _xmlui_parent, value, read_only=False): diff -r c005c212b538 -r 675e0e9f1653 frontends/src/tools/xmlui.py --- a/frontends/src/tools/xmlui.py Tue Aug 18 10:04:47 2015 +0200 +++ b/frontends/src/tools/xmlui.py Tue Aug 18 10:35:44 2015 +0200 @@ -83,34 +83,49 @@ often called Edit in toolkits """ + pass + + +class JidInputWidget(Widget): + """Input widget wich require a string + + often called Edit in toolkits + """ + pass class PasswordWidget(Widget): """Input widget with require a masked string""" + pass class TextBoxWidget(Widget): """Input widget with require a long, possibly multilines string often called TextArea in toolkits """ + pass class BoolWidget(Widget): """Input widget with require a boolean value often called CheckBox in toolkits """ + pass class IntWidget(Widget): """Input widget with require an integer""" + pass class ButtonWidget(Widget): """A clickable widget""" + pass class ListWidget(Widget): """A widget able to show/choose one or several strings in a list""" + pass class Container(Widget): @@ -129,6 +144,7 @@ class PairsContainer(Container): """Widgets are disposed in rows of two (usually label/input) """ + pass class TabsContainer(Container): @@ -136,13 +152,16 @@ Often called Notebook in toolkits """ + pass class VerticalContainer(Container): """Widgets are disposed vertically""" + pass class AdvancedListContainer(Container): """Widgets are disposed in rows with advaned features""" + pass class Dialog(object): @@ -176,10 +195,12 @@ class MessageDialog(Dialog): """Dialog with a OK/Cancel type configuration""" + pass class NoteDialog(Dialog): """Dialog with a OK/Cancel type configuration""" + pass class ConfirmDialog(Dialog): @@ -194,6 +215,7 @@ class FileDialog(Dialog): """Dialog with a OK/Cancel type configuration""" + pass class XMLUIBase(object): @@ -386,6 +408,9 @@ elif type_=="string": ctrl = self.widget_factory.createStringWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) + elif type_=="jid_input": + ctrl = self.widget_factory.createJidInputWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) + self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) elif type_=="password": ctrl = self.widget_factory.createPasswordWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) diff -r c005c212b538 -r 675e0e9f1653 src/tools/xml_tools.py --- a/src/tools/xml_tools.py Tue Aug 18 10:04:47 2015 +0200 +++ b/src/tools/xml_tools.py Tue Aug 18 10:35:44 2015 +0200 @@ -59,6 +59,9 @@ elif field.fieldType == 'text-single': widget_type = "string" widget_kwargs['read_only'] = read_only + elif field.fieldType == 'jid-single': + widget_type = "jid_input" + widget_kwargs['read_only'] = read_only elif field.fieldType == 'text-multi': widget_type = "textbox" widget_args[0] = u'\n'.join(field.values)