KDE Control Center Modules
Prev
Next

Chapter 6. KDE Control Center Modules

PyKDE Extensions can also help create modules for the KDE Control Center. C++ glue code is needed when writing in module in Python. Fortunately PyKDE Extensions can generate this glue for you automatically.

The best way to start learning about creating modules is to read the KConfig Module HOWTO. It is written for C++, but the concepts are the same for Python.

In your setup.py file you can specify the list of kcontrol modules that need to be installed.

    kcontrol_modules = [ ('src/kcontrol_module.desktop','kcontrol_module.py')] )
This is just a list of tuples. The first item is name of the .desktop file that you've made for your module. The second item is the name of the Python program to run when the user views the module in kcontrol. This program is expected to be in the application's data files directory.

The KControl Module Guidelines provides useful information about how to design a KControl module that fits into the rest of KDE.

Tip

PyKDE Extensions typically installs the .desktop file into the /usr/share/applications/kde/ directory. This is normally enough to make the module appear in the KDE Control Center. But for some distributions, most notably Mandriva but probably others too, this isn't enough. Mandriva in particular uses the Debian menu system for managing the K menu and also for KControl modules. In order to get a module to appear in the kcontrol it is best to createa a .menu file and copy it into /usr/lib/menu, and then use update-menus as root to update all of the menus and the list of kcontrol modules.

Note

Right now there is no support for "module-testing" or "X-KDE-Test-Module=true" features in .desktop files.

Prev
Next
Home