This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
Update Preference Model
- From: Adam Jocksch <ajocksch at redhat dot com>
- To: frysk at sources dot redhat dot com
- Date: Thu, 09 Mar 2006 15:30:20 -0500
- Subject: Update Preference Model
Ok, over the last couple weeks Sami and myself have come up with what we
think is a fairly robust and extensible model for the preferences in
Frysk. Types of preferences are modeled by a class (eg. IntPreference,
ColorPreference), through which you can retrieve the current value, set
a new value, and add a listener to be notified when the preference
changes. These preferences are then organized into preference groups,
which have a name and can return an iterator to all the preferences in
the group. We're also planning on having subgroups at some point, so a
group can have one or more subgroups beneath it.
These groups are then registered with the PreferenceManager. When a
group is registered with the PreferenceManager it will automatically
show up in the PreferenceWindow in the left TreeView (along with it's
subgroups as children), and the preferences in that group will appear in
the right pane when that option is selected. When the window is closed
all preferences are saved into the model and the listeners are notified
of the update. Hitting cancel undoes all changes and reverts the
preferences to their previous state.
Let us know what you think, any feedback is always appreciated :)