Configuration API
Waldo Bastian
bastian at kde.org
Thu Apr 29 23:31:42 EEST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu April 29 2004 19:06, Sean Middleditch wrote:
> These schemas can even be used in app-specific preferences windows. For
> example, say we have a web browser and it has a key (an integer) which
> maps to an enumeration controlling some behaviour (load all images, load
> images from same server, do not load images). The schema could specify
> the format as an enum with values 1, 2, 3 and labels "All Images",
> "Images from Server", and "No Images". (The labels could even include
> translations.) This will make gconf-editor look a little cleaner for
> this specific setting. But the browser preferences window could also
> use this information. This way, the developer needs only change their
> code that uses the preference (the image loading check) and their schema
> file; their UI maps accordingly. It reduces the effort put into a
> preferences window, reduces the chance of things getting out of sync,
> keeps documentation/translations in one place instead of two (or more),
> and so on.
This is what we do with KConfigXT. The on-disk config contains e.g.
"AllImages" and the lookup code translates that back to an enum value such as
EnumAllImages.
It's also possible to map such entry directly to a widget in a preference
dialog, a combo-box for example. In that case the specification of the
config-entry should also have translatable labels for all of the enum values.
Cheers,
Waldo
- --
bastian at kde.org | SUSE Linux 9.1 Order Now! | bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAkWYuN4pvrENfboIRAorlAKCn+BoswJo5jg2eP3Wg/PNc1dIOWACcDBJf
FaMpE7l0rU2z2nTz/v/WKcY=
=a9l0
-----END PGP SIGNATURE-----
More information about the xdg
mailing list