Re: edit | options ...

Paul Rohr (paul@abisource.com)
Tue, 12 Oct 1999 19:24:27 -0700


At 07:58 PM 10/12/99 -0500, Stephen Hack wrote:
>http://argus.itg.uiuc.edu/~shack/abisource/options.gif for a current picture

Looks cool. Could you also add a "Rechec&k document" button at the bottom
to reset anything that got ignored?

>I have some questions about the internal storage. These options, most of
them
>if not all, will be appPersistant. Where will the information be stored? I
>know that the AppPers class takes care of initializing one instance and such.
>But, my question is, is their some global repository of configurations data?
>or should I query the dialog (yuck)?
>
>I've not looked around too much as of yet, but i'll be needing some place to
>start.

Jeff's travelling (yes, again) so here are a few pointers to get you
started. Believe the code if it conflicts with my ultra-quick gloss, and if
the code's not clear, ask more questions on this list. By the time you get
to that point, he should be back.

The existing prefs mechanism uses an XAP_Prefs member variable hanging off
the XAP_App which allows you to switch between various XAP_PrefsScheme
instances. These schemes can be partial, in that the prefs mechanism will
always fall back to a hardwired set of builtin defaults. (Never let it be
said that Jeff doesn't believe in full generality when he solves a problem.)

Each individual preference setting is stored as a key / value pair of
XML_Char strings. The keys and default values are defined in the following
files:

abi/src/af/xap/xp/xap_Prefs.h
abi/src/wp/ap/xp/ap_Prefs_SchemeIds.h

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.

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



This archive was generated by hypermail 1.03b2.