lad1337/XDM — pull request #149 by pannal (2014-03-03 05:11:07+00:00)
Title: Add support for advanced config values/multiple selections in settings

This adds support for arbitrary ComplexDataTypes, at the moment: ListType derivates as of Select (single selection, to be tested) and MultiSelect (multiple selections for one config value). Those lead to self._config supporting dictionaries.
Data is saved as a dumped json state of the current object in the new _value_data field in class Config, which should be correctly migrated (I guess I didn't get the whole migration process correctly).

Defining a config value as a dict would be like following:
```
{
"options" [...],
"selected": [...],
"use_checkboxes": boolean or "inline",
"required": boolean,
}
```

for example in my to-be-released AdvancedMover plugin (look at "allowed_extensions"):
```
class AdvancedMover(PostProcessor):
"""
more or less advanced moving postprocessor
"""
identifier = 'de.pannal.advancedmover'
version = "0.1"
_config = {
'copy': False,
'skip_sample': False,
"replace_space_with": " ",
'final_path': "",
"rename_folders_to_element": False,
"rename_files_to_element": False,
'allowed_extensions': {
"options": [".avi", ".mkv", ".iso", ".mp4", ".m4v", ".mp3", ".flac",
".aac", ".nfo", ".png", ".gif", ".bmp", ".jpg"],
"selected": [".avi", ".mkv"],
"use_checkboxes": True,
}
}
```

"options" defines the various selections a config variable may have, "selected" defines the default selected of those.

The default behaviour results in a config representation in the frontend.

Setting "use_checkboxes" to anything else than False/None switches to . Supplying "inline" as the value for "use_checkboxes" switches to the inline-type-of-checkbox-view Bootstrap knows.

Setting "required" to True results in not being able to effectively save none selected values (behaviour is only in the frontend, not verified in backend).