Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0249.py @ 968:75f3b3b430ff
tools, frontends, memory: param definition and XMLUI handle multi-selection for list widgets:
- we need to update urwid_satext to revision 79
- no more "value" attribute value in the "list" element, use
HTML-style "select" attribute in the "option" elements instead
- /!\ param saving do not handle multiple values yet!
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 01 Apr 2014 21:21:13 +0200 |
parents | 1a759096ccbd |
children | 301b342c697a |
comparison
equal
deleted
inserted
replaced
967:242bd4fc654c | 968:75f3b3b430ff |
---|---|
57 | 57 |
58 params = """ | 58 params = """ |
59 <params> | 59 <params> |
60 <individual> | 60 <individual> |
61 <category name="%(category_name)s" label="%(category_label)s"> | 61 <category name="%(category_name)s" label="%(category_label)s"> |
62 <param name="%(param_name)s" label="%(param_label)s" value="%(param_default)s" type="list" security="0"> | 62 <param name="%(param_name)s" label="%(param_label)s" type="list" security="0"> |
63 %(param_options)s | 63 %(param_options)s |
64 </param> | 64 </param> |
65 </category> | 65 </category> |
66 </individual> | 66 </individual> |
67 </params> | 67 </params> |
68 """ % { | 68 """ % { |
69 'category_name': AUTOJOIN_KEY, | 69 'category_name': AUTOJOIN_KEY, |
70 'category_label': _("Misc"), | 70 'category_label': _("Misc"), |
71 'param_name': AUTOJOIN_NAME, | 71 'param_name': AUTOJOIN_NAME, |
72 'param_label': _("Auto-join MUC on invitation"), | 72 'param_label': _("Auto-join MUC on invitation"), |
73 'param_default': AUTOJOIN_VALUES[0], | 73 'param_options': '\n'.join(['<option value="%s" %s/>' % \ |
74 'param_options': ['<option value="%s"/>' % value for value in AUTOJOIN_VALUES] | 74 (value, 'selected="true"' if value == AUTOJOIN_VALUES[0] else '') \ |
75 for value in AUTOJOIN_VALUES]) | |
75 } | 76 } |
76 | 77 |
77 def __init__(self, host): | 78 def __init__(self, host): |
78 info(_("Plugin XEP_0249 initialization")) | 79 info(_("Plugin XEP_0249 initialization")) |
79 self.host = host | 80 self.host = host |