System settings architecture

The System Settings application is a container for various pluggable elements which provide the configuration options. According to the current design, such elements can be simple widgets (such as the "Flight Mode" switch) or visual placeholders which open a separate page of settings when clicked. It might also be possible to directly open a settings sub-page from the Dash or some other application, so the plugin architecture needs to take this possibility into account.

Plugin manifest file

When the System Settings application starts up, it scans a well defined sequence of file system directories (/usr/share/ubuntu/settings/system/) looking for plugin manifest files. A manifest file name must end in .settings and the file contents must be stored in JSON format.

Defined keys

The following top-level keys are defined for the manifest files:

  • name: translatable plugin name.

  • icon: icon name (for themed icons) or full path to an image.

  • category: category. TBD.

  • priority: integer value specifying the order of appearance of the plugin within its category; given the same priority value, plugins will be sorted alphabetically according to their translated name (if name is not given, sorting is undefined).

  • translations: translation domain.

  • form-factors: list of form factors this plugin is relevant for (the plugin won't be shown on those form factors where it's not relevant). TBD: form factor names.

  • keywords: list of keywords (for the search feature).

  • plugin: name of plugin implementing the settings UI. (optional: if not defined then the default plugin will be used)

  • has-dynamic-keywords: boolean value, telling whether the plugin can provide dynamic keywords. The System Settings container might use this information to decide when to load the plugin.

  • has-dynamic-visibility: boolean value, telling whether the plugin visibility can be determined by the plugin itself only

Any other information present in the manifest file will be ignored by the System Settings application, but will be provided to the plugin binary when loading.

Loading of the plugin binary

The System Settings application expects the plugin binaries to be located in /usr/lib/$(arch)/ubuntu-system-settings/lib<plugin>.so, where <plugin> is the value of the plugin key in the manifest file. The operation of loading the plugins might be delayed to a later time to increase user-perceived performance.

If both the name and icon keys are missing, the plugin will be loaded as soon as the System Settings application starts, and will be asked to provide a QML component to be placed in the System Settings page.

Default Plugin

The default plugin gets the JSON file which provides the set of items that can be displayed in the settings. This uses a schema that starts from an array of items that should be shown in the first level of the hierarchy under the root level key hierarchy. Each item in the array is an object with the following properties:

  • type: What type of item it is. Choices currently are:

    • widget: This should be a specific item generated from QML widget library

SystemSettings/Architecture (last edited 2013-09-03 13:06:46 by seb128)