Chapter 7: GConf


Highlights

Most applications allow the user to customize their appearance and behavior, saving a list of configuration values somewhere on the system. Certain programs require very few parameters (Gnomine's field and square size , for example), and some applications, like the Epiphany web browser, have a tremendous number of possibilities in their menus and settings windows . The number of configuration values doesn't matter ” somewhere or other, you still have to code the system.

Conventional user configuration support proceeds roughly as follows :

  1. Define data structures or simple variables for the values.

  2. Export these values to all parts of the application.

  3. Create a configuration dialog for the user to alter the values.

  4. Make sure that the application writes the values to a file when the user quits the application.

  5. Have the application read values from this file at startup.

Several problems can crop up. How does the application know when a configuration value changes? What file format should you use, and where should you put the file? How do you deal with concurrent access to the configuration file? And do you have to reinvent the wheel for every new application?




The Official GNOME 2 Developers Guide
The Official GNOME 2 Developers Guide
ISBN: 1593270305
EAN: 2147483647
Year: 2004
Pages: 108

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net