preferences service, a first implementation
Guillaume Chereau
charlie at openmoko.org
Tue Jun 10 11:49:45 CEST 2008
Hello all !
Today I worked on the first draft of the configurations (or preferences)
service.
I didn't use an existing system, because I want something small, and
that is aware of the profiles (because many applications have parameters
that depend of the profile)
The main points are :
- All the configuration and schema are stored into YAML files.
(http://www.yaml.org/)
- Every service that uses the service should create a schema file,
giving information about the parameters. A typical schema file looks
like this:
vibration: # The name of the parameter
type: bool # The type
default: yes # default value
profilable: yes # set to yes if the parameter depends of the profile
ring-volume:
type: int
default: 10
profilable: yes
the name of the file is the name of the service providing those
parameters (for example, "schema/phone.yaml" )
The configurations values for a given service AND for a given profile
are stored in the file :
conf/$(service)/$(profile).yaml
So for example I could have the following file structure:
conf/
phone/
default.yaml
silent.yaml
outdoor.yaml
music/
default.yaml
A typical conf file looks like this :
vibration: Yes
ring-volume: 9
- the server provides this simple dbus api :
== interface "org.freesmartphone.conf" ==
- method set_profile(s)
- method get_service(s) -> o // return a proxy to a service conf
// implemeting org.freesmartphone.conf.service
== interface "org.freesmartphone.conf.service" ==
- method set(s,v) // set a key value (in the current profile)
- method get(s) -> o // get a key value (in the current profile)
- signal notify(s,v) // emitted when a parameter value changes
OK That's it for the moment. I implemented this with python.
Comment are welcome :)
Mickey, can I put the code in the git repository ?
- Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxtogo.org/pipermail/smartphones-standards/attachments/20080610/09bdeefa/attachment.pgp>
More information about the smartphones-standards
mailing list