There is one thing that has sort of been bugging me since my involvement with Kubuntu. We have all these great configuration/admin tools written with python, but until now they are all standalone applications, and I couldn’t do anything about that.
Until now. Actually it’s more like 3 months ago, but python KConfigModules (KCM) required KDE 4.2. Yesterday Sime (Simon Edwards) posted a link to an example of a python KCM. A mere 20 lines of code later I had System Settings displaying a non-functional GUI.
Then I worked on it all day, taking the guts of the jockey-kde script and adding it to the KCM in a way that would make it work. But after I finally got through the last syntax and AttributeErrors, guess what System Settings does. It crashes.😦
Python crashes to be more specific. Either it’s a bug in PyKDE or I’m doing something really-evil-but-syntactically-correct. It could be the jockey-backend which runs in a separate thread causing issues. In fact, everything was working fine until I wired in the AbstractUI (jockey-lib class which populates any jockey-gui, regardless of toolkit) so I’m pretty sure that has at least something to do with it.
But if it did work, it would probably look something like this: (I hacked up a bit o’ code to populate the ui statically)
(Current, real jockey-kde on the left, mock of jockey-kcm on the right, click for full size)
-Definite mockup material
-Yes, there is no icon next to the driver name in the list, shouldn’t be a problem in the real thing
-Yes, the Ubuntu certification and License type are swapped. Easily changed but I’m too lazy to right now.
On the plus side it looks less like a super-vertical Gnome-style dialog and more like a KDE configuration module. (Because it is :P) If only there were a way to make the driver name not as long….
Pending that crash, I am pretty hopeful for a jockey kcm in System Settings for Jaunty.🙂 Hopefully we can get system-config-printer-kde, the software-sources tool we are launching with adept, and and kde4 port of userconfig in as KCMs too. (I’m not personally involved with any of these… yet. :P)
Oh, and the source code. You can find the code here. Maybe some experienced pythonistas can tell me what the !@#$ I’m doing to make kcmshell/systemsettings/python crash…
To install/use it, copy jockey-kcm.desktop to /usr/share/kde4/services. Then make a /usr/share/kde4/apps/jockey directory and add mainkcmwidget.ui and jockey-kcm.py to it. Run kbuildsycoca4 for good measure and then either launch it from the “System” section in the advanced tab of systemsettings or run “kcmshell4 jockey-kcm” from el konsoledoro. Expect it to crash.😛