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!
This commit is contained in:
parent
8fa0b7b8c2
commit
608e2ba9fa
1 changed files with 82 additions and 39 deletions
|
|
@ -102,13 +102,13 @@ class PrimitivusTextBoxWidget(xmlui.TextBoxWidget, sat_widgets.AdvancedEdit, Pri
|
|||
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 PrimitivusButtonWidget(xmlui.ButtonWidget, sat_widgets.CustomButton, Primi
|
|||
|
||||
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()]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue