I noticed that there is only one "boolean" preference option, but I'm about to
add many more. I've been sticking to the 0/1, but have been considering
adding a
XAP_PrefScheme::getPrefsValueBool(XML_Char * szKey, UT_Bool ** pbValue);
(of course w/ the consts back in)
function to accept 0/1 t/f true/false yes/no.
Will this be over kill? Even if we limit it to 0/1, I think we should have a
function to return just a bool. That way, any changes to the acceptable
values will not require a recursive grep on getPrefsValue
If so, I could send a patch.
> For examples of how they're referenced, do a recursive grep across the tree
> for usage of "getPrefsValue" from an app pointer. It's pretty simple,
> really.
>
> Currently the prefs mechanism loads back and forth from disk, but as far as
> the app's concerned it's still read-only. For your purposes, I presume
> we'll need to add a setPrefsValue() member to XAP_Prefs or something. It
> also looks like there'll need to be corresponding methods added to the App
> classes, but you may want to get Jeff involved for that. He may remember
> why they got factored all the way out to app-specific platform code. At the
> moment, I don't.
I have not had a problem adding values (or atleast changing values) to a
preference scheme.
I saw a reference in a source code TODO to a future feature to be added to the
preferences code. This feature, event call backs for when prefs get changed.
This will allow the XAP_Prefs (and friends) keep track and notify the
appropriate sections of code to handle the changing of preference values.
Is there any plans or talk on this?
> If you're comfortable going ahead to implement this yourself, just make sure
> that any prefs changed by the UI get stored to a scheme other than
> "_builtin_" because that represents the hardwired defaults. If any other
> scheme is currently selected, use that. Otherwise, create some new scheme,
> say "_custom_" or something. (I'm guessing that the logic to implement this
> particular rule probably belongs in XAP_Prefs.)
>
> Hope that helps.
>
> Paul
>
Well, hopefully either tomorrow or tuesday I should have some code to submit.
Currently I have the dialog changing values and saving the appropriate stuff
in the Abiword.prefer file. Most of what needs to be done is clean up...
move stuff from unix/ap_UnixDialog_Options to the ap/ap_Dialog_options files.
and attempt to stub in dialogs for windows and beos.
-shack