ListItems.ValueSelector doesn't work well with dynamic options
Bug #1201872 reported by
Ken VanDine
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
It would be nice if the ValueSelector could be backed by a model that could work as a map of sorts. This would be useful for dynamically creating a list of options and properly dealing with the selected choice. For example, you might want to display a user friendly and translated string for a setting in the option, but when selected store a value that is meaningful to the application that is going to use it. Like "Mention Only" could then be mapped to "mentions-only" without needing to do a big switch statement. Or listing files in a directory for choosing a sound for an event.
no longer affects: | ubuntu-ux |
To post a comment you must log in.
I just hit that problem working on the system-settings' sound panel.
The code there lists the soundfiles in a directory to display them on screen, we do want to make the name a bit better but still write the actually filename to the configuration
e.g "incoming- message. ogg" should be displayed as "Incoming message" in the list, but selecting it should set the configuration key to "incoming- message. ogg"