diff --git a/frontends/src/primitivus/xmlui.py b/frontends/src/primitivus/xmlui.py index e8b7c940..85fb51a6 100644 --- a/frontends/src/primitivus/xmlui.py +++ b/frontends/src/primitivus/xmlui.py @@ -102,6 +102,10 @@ class PrimitivusStringWidget(xmlui.StringWidget, sat_widgets.AdvancedEdit, Primi 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 --git a/frontends/src/tools/xmlui.py b/frontends/src/tools/xmlui.py index 83ab8db7..e561c9f5 100644 --- a/frontends/src/tools/xmlui.py +++ b/frontends/src/tools/xmlui.py @@ -83,34 +83,49 @@ class StringWidget(Widget): 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 Container(Widget): class PairsContainer(Container): """Widgets are disposed in rows of two (usually label/input) """ + pass class TabsContainer(Container): @@ -136,13 +152,16 @@ class TabsContainer(Container): 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 Dialog(object): 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 ConfirmDialog(Dialog): class FileDialog(Dialog): """Dialog with a OK/Cancel type configuration""" + pass class XMLUIBase(object): @@ -386,6 +408,9 @@ class XMLUIPanel(XMLUIBase): 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 --git a/src/tools/xml_tools.py b/src/tools/xml_tools.py index 3bc14945..48c94b75 100644 --- a/src/tools/xml_tools.py +++ b/src/tools/xml_tools.py @@ -59,6 +59,9 @@ def _dataFormField2XMLUIData(field, read_only=False): 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)