The various options are:I hate duplicate code ;). So in kit would be nice place.
- The preference panel writes a settings file, the server reads it. No
shared code.
- Same as above, but the code is shared by having the Jamfile of one
component reuse sources of the other
- Variant: the shared code is in a separate directory
(src/kits/shared, or src/libs for example)
- The preference panel somehow communicates with the server and theThat I didn't thought about
server writes the file
- Examples: setting display brightness, configuring mouse settings
- The API can be public, allowing other tools to alter the settings
(for example the screen brightness can be set from the command line
screenmode tool as well)
I think moving settings management to the server is interestingYes ok.. so when you quit you computer? What happends when it crashes? Perhaps not a problem. Would it be a problem one could save it to a tempfaile and then when the server shuts down we swaps files.
because it allows any user-space application to change the setting. As
shown above this is useful when you have both a command line and a
graphical application (it's the case for screen mode, or for network
devices for example). It also goes well with our idea of making the
settings apply live, but there are some things to keep in mind
To keep the example of screen brightness, it is not written to the
file immediately when the setting changes. The reason is, doing so
would mean sliding the brighness slider in screen preferences would
result in the file being rewritten everytime the mouse moves. Not a
great option. So instead, the setting is applied live, but the file is
written only when app_server shuts down.