From: Thomas Leonard <tal00r@ec...> - 2001-12-16 16:57:07
I've made a few more changes to the options system.
Before, we did this:
- Register each option while initialising, setting defaults for each one.
- Load the options file, changing the option values as we go.
- Load the options file, storing each value in a temporary area.
- Register each option, using the stored value instead of the default, if
The advantage is, an option can be used as soon as it is registered
(before, you had to wait until everything else had initialised too).
This was a problem for the internationalisation code, which needs to
discover the language setting early on, and was therefore storing its
setting in a separate file. Now, it's stored in Options.
This does mean you'll have to reset the language option after upgrading.
The second change is that instead of the various types of widget used to
control the options being hard-coded into options.c, new widgets can now
be registered with option_register_widget(name, builder).
The builder function gets called when processing Options.xml, and creates
the widgets. It also sets the functions to read and update them.
This more modular system may be useful for libraries. It also gets rid of
the dependancy of options.c on toolbar.c, since toolbar.c now just
registers the toolbar config widget itself.
As always, it needs testing...
Thomas Leonard http://rox.sourceforge.net