diff frontends/src/primitivus/xmlui.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 b70fb2ac5997
children 5c7707c958d8
line wrap: on
line diff
--- a/frontends/src/primitivus/xmlui.py	Tue Apr 01 16:27:59 2014 +0200
+++ b/frontends/src/primitivus/xmlui.py	Tue Apr 01 21:21:13 2014 +0200
@@ -102,13 +102,13 @@
         sat_widgets.AdvancedEdit.__init__(self, edit_text=value, multiline=True)
 
     def _xmluiGetValue(self):
-        return self.getValue()
+        return self.get_edit_text()
 
 
 class PrimitivusBoolWidget(xmlui.BoolWidget, urwid.CheckBox, PrimitivusEvents):
 
     def __init__(self, parent, state):
-        urwid.CheckBox.__init__(self, '', state = state)
+        urwid.CheckBox.__init__(self, '', state=state)
 
     def _xmluiGetValue(self):
         return "true" if self.get_state() else "false"
@@ -122,12 +122,16 @@
 
 class PrimitivusListWidget(xmlui.ListWidget, sat_widgets.List, PrimitivusEvents):
 
-    def __init__(self, parent, options, flags):
+    def __init__(self, parent, options, selected, flags):
         sat_widgets.List.__init__(self, options=options, style=flags)
+        self._xmluiSelectValues(selected)
 
     def _xmluiSelectValue(self, value):
         return self.selectValue(value)
 
+    def _xmluiSelectValues(self, values):
+        return self.selectValues(values)
+
     def _xmluiGetSelectedValues(self):
         return [option.value for option in self.getSelectedValues()]