Le 8 mai 06 à 08:28, Yen-Ju Chen a écrit :

I am thinking to write a background preference to set background picture.
Surely I can put it with system preferences in GNUstep,
but I prefer to put it in Etoile. :)

I would prefer ;-)

The first question is how Etoile manage the preferences.
There are two fake preference application in SVN (LookAndBehavior and Hardware). Do we go for all-in-one style as in MacOS X (and system preference of GNUstep),
or one-by-one as Windows ?
It seems to be the later one for now.

I'm set on an intermediate solution which consists of four applications broken in several panes. The four applications are :

- Look and Behavior
- Appearance (to load packaged themes, and adjust fonts, colors preferences)
        - Background & Notes
        - Shelf
        - Date & Time
        - Languages
- Location (to handle several locations with different settings where you use your computer) - Gesture (to adjust gesture recognition and actions which are associated) - Advanced (to adjust things like attributes support, extensions use, hidden file system parts, etc.)

- Hardware
        - Keyboard
        - Mouse
        - Monitor
        - Sound
        - Power Settings
        - Startup Disk


- Network
        - Bookmarks (to specify how bookmarks are handled, rely on BookmarkKit)
        - Internet (to easily set network settings related to Internet use)
        - Network Options
        - Network Services

- Users
        I haven't take time to think about Users application panes

The benefit of this split choice :
- to allow switching from the current pane to the other ones listed in toolbar without having to move back to a main place
- to put together related panes
- to avoid the all-in-one solution which is effective, but tends to be overcrowded then less usable, especially when new third-party panes starts to pile up in the window.

Thanks to the PreferencesKit, each Preferences applications is just a shell that you can fill with .prefpane bundles (they have to be installed correctly though) and optionally you provide special plist entry to tell what shouldn't be loaded. Because of the shell nature of Preferences applications, it is very easy to reshuffle panes between them, to welcome new panes etc.

By the way, the main window of both of LookAndBehavior and Hardware
are broken now.
There is no title bar and is not movable.
Is it a known bug ?

I'm unware of this bug. It wasn't the case two months ago.

The second question is how these preferences are set when the system is up ?

Just rely on Defaults.

In my case, user can set the background picture and the background preference
can set the background of xwindow root window.
But when user starts xwindow for the next time and later,
this background preference is not executed.
Therefore, the background will not be set again.
I can have Azalea to read this preference and set the xwindow background right.
But some preferences may not have a main application in charge with.

Very few ones I think, because mouse, keyboard, screen, network all that kinds of preferences are going to be set in Defaults and replicated on the fly on the host system conf files (GNOME System Tools Backend is taking care of reading/writing these conf files with an XML exchange format).

I wonder how these preferences will be set ?

We will just use NSUserDefaults and probably a custom subclass returned by a new method called like -systemDefaults. We would use the traditionnal setObject:forKey and objectForKey: semantic to read and write preferences/defaults. Behind the scene this custom subclass would take care to replicate the change at host system level, by passing the value and the key (properly encoded in the XML format I mentioned previously) to GNOME System Tools Backend. When we request a default, we receive XML stream from GNOME System Tools Backend that our NSUserDefaults subclass takes care to convert… then we can reflect the obtained values on our UI. On UI edit, we would trigger the same flow in the opposite way.

Is there a daemon to read through these preferences and set it right ?

Not now, but it may be interesting to have one taking in account :
- preferences which aren't related to host system or any applications automatically running - transactionnal changes queue for GNOME System Tools Backend, because we could encounter conflicts if we trigger from two applications the edition of a conf file by having two instance of a tool trying to change it . Similar issue may exist with NSUserDefaults.
The object server dameon of CoreObject could play this role I think.

And is there a domain in NSUserDefaults to save these system preferences or each preference pane or preference application saves in its own domain ?

For host system specific preferences, a special domain should be created I think. Otherwise most of time the preference should be saved directly to its own preference pane domain, unless we prefer a new special domain to handle it (by defining a set of canonical keys to be used).

Quentin.

--
Quentin Mathé
[EMAIL PROTECTED]


_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à