Panel Applet Installer

What the Installer Does

The Panel Applet Installer that comes with PyKDE has the following features:

Running the installer

The installer is completely contained in 'pykpanelapplet/appletInstall.py' The installer may be run from any working directory. You must either be root to run the installer (with the ability to run X apps), or else use the following command line from an XTerm to run the installer with root privileges (assumes working directory is PyKDE/pykpanelapplet/ - provide path otherwise).

kdesu -t -c"python appletInstall.py"

kdesu will ask for your root password and if you provide it, run the installer.

Using the Installer

Installer

The Panel Applet Installer is shown above. The installer program requires you to be root to run it. Usage is fairly simple:

1. Enter a file name or click the button to the right of the line edit to browse the file system. When a vaild applet is entered, the installer display will change to this:

Installer Active

Since the "Test" and "Install" buttons are enabled, the installer has validated the file selected as a valid Python panel applet. Among other things, this means that the script selected:

You may also note (if you run the installer from an xterm) that the installer appears to be trying to create files it has no permission to create. This is a consequence of two things: the KPanelApplet constructor always tries to create a config file, even when passed None for that arg. Also, since the validate (silent) and "Test" (button) functions actually load and run the script (and the installer needs root permissions to actually do an install), the effective uid for test and validation activities is set to "nobody". User "nobody" doesn't have permission to create the files KPanelApplet would like to create.

The Desktop file edit boxes are already filled in - this indicates that the installer has also located and read a desktop file for the applet. If no desktop file is located, you can enter the desktop file info (name, comment, and 'unique' checkbox) anbd the installer will create a desktop file for you. If you don't enter that info before installing, the installer will provide default values (name and comment based on script name, checkbox unchecked).

Notice also that the "Replace existing applet" checkbox (middle of screen) is enabled and checked. This means the installer has located a previously installed applet with the same name. If you choose to install at this point, the previous applet's files and links will be deleted and the new applet's files and links will be installed. If you uncheck the box, installation will be disabled, but the "Test" button will still function.

2. (Recommended but optional) At this point, you can press the "Test" button. The following small dialog will appear:

Size Dialog

The "Horizontal" and "Vertical" radio buttons are enabled, meaning the installer has found "widthForHeight" and "heightForWidth" methods in the applet class. If only one were found, the corresponding radio button would be enabled and selected. If none were found, the "Ignore" radio button would be enabled and selected (disabled in the image above) The "Pixels" edit box allows you to select either the height (if Horizontal is selected) or width (if Vertical is selected) in pixels of the applet when run under test. If Ignore is selected, the applet will be square with the length of a side as specified in the "Pixels" edit box.

Clicking "OK" will launch the applet in a dialog box window. Clicking "Cancel" will cancel the test.

3. Installing - If the applet tests satisfactorily, click the "Install" button. The installer will create the .la file and desktop files (or use/modify the existing desktop file if found), symlink to the libpykpanelapplet.so lib, and copy the script selected and desktop file to the appropriate location, all with naming following the conventions described above. The applet should now be ready to load and run.

Writing Your Own Desktop File

You may want to include more information in your .desktop file - usually translations of the "Name" or "Comment" fields, or some other information. If the installer detects a .desktop file in the same directory as the script and with the same base name as the script, it will read the "Name" and "Comment" field values into the edit boxes at the bottom of the window, and use the value of "X-KDE-Unique" to set the checkbox value.

If you edit those fields/change the checkbox status, when you install the installer will modify your desktop file (the affected fields only, along with the "X-KDE-Library" field, which the installer sets) and copy your file to the kicker/applets directory instead of creating a new .desktop file.

Uninstalling

If you want to remove an applet from the system, start the installer as before and select the "Uninstall" tab: Note that a file has already been selected, activating the "Uninstall" button. Clicking the button will remove the .la file, the script, the desktop file, and unlink the symlink to the libpykpanelapplet.so lib.

Uninstaller