Meego Wiki
Views

SDK/Tablet/Tablet APIs/Settings API

From MeeGo wiki
Jump to: navigation, search

This section describes how to use the Settings API in your Tablet application.

Steps

  1. Setup your MeeGo development environment
    For tips on setting up a development environment for creating MeeGo applications, see your development Tablet SDK for Linux
  2. Install the Settings development package in MeeGo
    Inside QEMU, on your MeeGo-based tablet, or in an ssh command-line, do the following:
    $ sudo zypper install meego-ux-settings-libsettings
  3. The Settings API is an XML-like language. See the language documentation for more information.
  4. Create desktop file

See the Desktop specification for more information. The most important fields are the "Name", "Type" and a custom section labeled "[DCP]". "Type" must be "ControlPanelApplet". In the custom section, point to your XML settings file like this: "Part=/path/to/your/settings/file.xml". When you are done, place the desktop file in /usr/share/meego-ux-settings/apps. When the settings application is launched, it will look in this directory and create menu entries for each setting.

Here is an example desktop file:

[Desktop Entry]
Type=ControlPanelApplet
Name=Example Settings Applet
Icon=

[DCP]
Part=example.xml

Testing your settings

The following sample application can be used as a reference. It creates a simple window in which you can use to test your settings application.

  1. Download File:Settings-sdk.tgz
  2. Unpack and Build (note that settings-sdk.tgz is really a tar.bz2)
$ tar xvjf ./settings-sdk.tgz
$ cd tests
$ ./test-declarative-settings /path/to/your/settings.xml

You can also use meego ux settings to test your applet if available:

meego-qml-wrapper --app meego-tablet-settings --fullscreen --cmd showPage --cdata NameOfSettingsPage

Contained in this attachment are sample desktop and XML examples.

Personal tools