diff src/plugins/plugin_misc_text_syntaxes.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 4cc55e05266d
children 301b342c697a
line wrap: on
line diff
--- a/src/plugins/plugin_misc_text_syntaxes.py	Tue Apr 01 16:27:59 2014 +0200
+++ b/src/plugins/plugin_misc_text_syntaxes.py	Tue Apr 01 21:21:13 2014 +0200
@@ -77,8 +77,7 @@
     <params>
     <individual>
     <category name="%(category_name)s" label="%(category_label)s">
-        <param name="%(name)s" label="%(label)s"
-           value="%(default)s" type="list" security="0">
+        <param name="%(name)s" label="%(label)s" type="list" security="0">
             %(options)s
         </param>
     </category>
@@ -91,7 +90,6 @@
         'category_label': _(CATEGORY),
         'name': NAME,
         'label': _(NAME),
-        'default': _SYNTAX_XHTML,
         'syntaxes': {},
         }
 
@@ -128,7 +126,8 @@
         options = []
 
         for syntax in syntaxes:
-            options.append(u'<option value="%s" />' % syntax)
+            selected = 'selected="true"' if syntax == _SYNTAX_XHTML else ''
+            options.append(u'<option value="%s" %s/>' % (syntax, selected))
 
         TextSyntaxes.params_data["options"] = u'\n'.join(options)
         self.host.memory.updateParams(TextSyntaxes.params % TextSyntaxes.params_data)