Mercurial > libervia-backend
diff 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 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0249.py Tue Apr 01 16:27:59 2014 +0200 +++ b/src/plugins/plugin_xep_0249.py Tue Apr 01 21:21:13 2014 +0200 @@ -59,7 +59,7 @@ <params> <individual> <category name="%(category_name)s" label="%(category_label)s"> - <param name="%(param_name)s" label="%(param_label)s" value="%(param_default)s" type="list" security="0"> + <param name="%(param_name)s" label="%(param_label)s" type="list" security="0"> %(param_options)s </param> </category> @@ -70,8 +70,9 @@ 'category_label': _("Misc"), 'param_name': AUTOJOIN_NAME, 'param_label': _("Auto-join MUC on invitation"), - 'param_default': AUTOJOIN_VALUES[0], - 'param_options': ['<option value="%s"/>' % value for value in AUTOJOIN_VALUES] + 'param_options': '\n'.join(['<option value="%s" %s/>' % \ + (value, 'selected="true"' if value == AUTOJOIN_VALUES[0] else '') \ + for value in AUTOJOIN_VALUES]) } def __init__(self, host):