Home · All Namespaces · All Classes

Launcher

Main menu

The main menu is a central place from where the user can launch applications and bookmarks. Main menu entries are defined in freedesktop.org desktop entry files with the .desktop extension. Not all features of the desktop entry specification are supported. The supported features are listed in this document.

The system wide desktop entry files must be installed to /usr/share/applications. User specific desktop entry files can be installed to $HOME/.local/share/applications. However, they will not override system-wide desktop files with the same name in /usr/share/applications.

Each desktop entry file must define values for the Icon, Name and Type keys.

The Icon must specify the absolute path or ID of the icon that is used to represent the item in the main menu. If an icon ID is used the icon will first be located as described in the Icon Theme Specification. If an icon with the given ID is not found from those locations the icon is taken from the MeeGo Touch theme with the given ID.

The Name must be set to the unlocalized name of the item. Localized names can be additionally provided. See MDesktopEntry documentation how to define localized names.

For applications the Type must be set to Application. For bookmarks the Type must be set to Link.

Applications in main menu

In addition to the Icon, Name and Type keys, each application desktop entry file must define a value for the Exec key.

The Exec key defines an application binary to be launched. However there is a more preferred way to specify what will be launched from the home screen: the X-Maemo-Service key. This key defines the service to be launched.

Note that even though the X-Maemo-Service key is specified, the Exec key needs to be specified as well. If both an X-Maemo-Service and Exec key are specified, the Exec key is ignored.

The purpose of the X-Maemo-Service key is to ensure that there be only a single instance of any application. Successive launch attempts will result in the first instance becoming visible. Note that, for an application to be launched using the X-Maemo-Service key, the application should also define a .service file. See MApplicationService documentation for more information.

To be able to launch multiple instances of an application, the application needs to specify their own class that derives from MApplicationService and implements custom behaviour. See MApplicationService documentation for more information. This is also true if the Exec key is specified.

The home screen main menu respects the OnlyShowIn and NotShowIn keys of desktop entry files. The correct value is X-MeeGo. So in order to have the application only visible in Duihomescreen main menu (and not e.g. KDE or GNOME) one can specify OnlyShowIn=X-MeeGo;. And if the application should not be visible in Duihomescreen main menu one can specify NotShowIn=X-MeeGo;.

An example application desktop entry file might look like this:

[Desktop Entry]
Type=Application
Name=My application
Exec=/usr/bin/my-app
Icon=my_app_icon_id
OnlyShowIn=X-MeeGo;

Bookmarks in main menu

As with all desktop files, system-wide bookmarks installed from packages can be placed to /usr/share/applications. However, user specific bookmarks should be placed in $HOME/.local/share/applications.

In addition to the Icon, Name and Type keys, each bookmark desktop entry file must define a value for the URL key.

The URL key defines an URL to be launched.

Example desktop entry file might look like this:

[Desktop Entry]
Type=Link
Name=nokia.com
URL=http://www.nokia.com/
Icon=my_bookmark_icon_id

D-Bus interface for showing button on a launcher

Launcher provides a D-Bus API, through which user can be transferred to an application's launcher button. showLauncher method takes an application's desktop file name as an argument in format "filename.desktop". The desktop file can be given in a path format, but only the file name is used when searching for the button. If an empty string is given as a parameter the launcher is only opened. Giving a desktop file that doesn't exist does nothing.

D-Bus interface:

<interface name="com.meego.core.HomeScreen">
    <method name="showLauncher">
        <arg name="desktopFileEntry" type="s" direction="in"/>
    </method>
</interface>

Showing installation and update progress of application in launcher and quicklaunchbar

ApplicationPackageMonitor listens to dbus signals from Package Manager and watches /usr/share/applications/installer-extra folder to receive info on package installation states and progress. Relevant information is signalled to Launcher and QuickLaunchBar, and state and progress information is stored for the button that represents this package. If we are installing a new package, a placeholder button is added to Launcher. Launcher buttons reflect the state and progress by using different icons and a progress indicator.

Note: Launcher assumes that installer-extra folder is created before starting the home screen. Otherwise, Launcher doesn't react to entries in the installer-extra folder before next startup.

See also:

Copyright © 2011 Nokia Corporation Generated on Thu Jul 7 2011 22:14:50
Doxygen 1.7.1
MeeGo Touch