This class is still under development. You can use this class to create and edit the so-called “desktop entries” as desktop configuration files (application/x-desktop) later on. These configuration files describe, for example, how a program is started or how a program appears in a menu. Some distributions have menu editors, others - like Lubuntu - do not have them. Obviously, the DesktopFile class has therefore been included in the gb. desktop component.
However, you can already get the exact specification of files for desktop entries under the link: http://standards.freedesktop.org/desktop-entry-spec/latest/ in the current version because Gambas follows this specification.
A desktop configuration file consists of the following elements:
# # Starter für die IDE von Gambas 3 # Pfad: ~/.local/share/applications/gambas341.desktop # [Desktop Entry] # Erforderliche Einträge Type=Application Name=Gambas 3.4.1 Exec=/usr/bin/gambas3 # Optionale Einträge Icon=/home/hans/gb341/app/src/gambas3/img/logo/logo-64.png Categories=Development Comment=Start der GAMBAS-IDE Version=3.4.1 Terminal=false
You can write the above lines with an editor of your choice and save the file in the user directory:
~/.local/share/applications/gambas341.desktop
to save them. No root privileges are required. However, if the desktop configuration file is to be system-wide, it must be saved in the following directory with root privileges:
/usr/share/applications/gambas341.desktop
After saving you will see the sub-menu 'Gambas 341' in the' Software development' section of the applications menu.
If you also want the starter to be visible on your desktop, you also need to copy the desktop configuration file to the ~/Workspace directory under Ubuntu 12.04. The configuration file must be copied to the directory ~/Workspace under Ubuntu 12.04 as well. You should change the name in the properties of the configuration file to a short form like 'GB 3.4.1' and make the file executable under Ubuntu!
It remains to be seen when this class is released for use.
Diese Klasse befindet sich gegenwärtig noch in der Entwicklung. Mit dieser Klasse können Sie später die so genannten “Desktop-Einträge” als Desktop-Konfigurationsdateien (application/x-desktop) anlegen und bearbeiten. Diese Konfigurationsdateien beschreiben zum Beispiel wie ein Programm gestartet wird oder wie ein Programm in einem Menü erscheint. Einige Distributionen verfügen über Menü-Editoren, andere – wie Lubuntu – besitzen diese nicht. Offensichtlich ist die Klasse DesktopFile deshalb in die Komponente gb.desktop aufgenommen worden.
Sie können sich aber bereits schon jetzt die genaue Spezifikation von Dateien für Desktop-Einträge unter dem Link: http://standards.freedesktop.org/desktop-entry-spec/latest/ in der aktuellen Version ansehen, weil Gambas dieser Spezifikation folgt.
Eine Desktop-Konfigurationsdatei besteht aus folgenden Elementen:
# # Starter für die IDE von Gambas 3 # Pfad: ~/.local/share/applications/gambas341.desktop # [Desktop Entry] # Erforderliche Einträge Type=Application Name=Gambas 3.4.1 Exec=/usr/bin/gambas3 # Optionale Einträge Icon=/home/hans/gb341/app/src/gambas3/img/logo/logo-64.png Categories=Development Comment=Start der GAMBAS-IDE Version=3.4.1 Terminal=false
Sie können die o.a. Zeilen mit einem Editor der Wahl schreiben und die Datei im Benutzerverzeichnis:
~/.local/share/applications/gambas341.desktop
abspeichern. Root-Rechte sind nicht erforderlich. Soll die Desktop-Konfigurationsdatei jedoch systemweit gelten, dann muss sie im folgenden Verzeichnis mit Root-Rechten abgespeichert werden:
/usr/share/applications/gambas341.desktop
Nach dem Speichern sehen Sie im Menü der Anwendungen in der Rubrik 'Software-Entwicklung' das Unter-Menü 'Gambas 341'.
Wenn der Starter auch auf dem Desktop zu sehen sein soll, dann muss die Desktop-Konfigurationsdatei auch in das Desktop-Verzeichnis ~/Arbeitsfläche unter Ubuntu 12.04 kopiert werden. Sie sollten dort in den Eigenschaften der Konfigurationsdatei noch den Namen in eine Kurzform wie 'GB 3.4.1' ändern und die Datei unter Ubuntu ausführbar machen!
Es bleibt abzuwarten, wann diese Klasse zur Nutzung freigegeben wird.