Monday, July 2, 2007

Quick and Dirty : clock applet patch for KOrganizer integration


A friend bugged me about the gnome clock applet that had evolution integration while the KDE clock applet doesn't have KOrganizer integration.
So I decided to hack something on it during the night...
The result can be seen here :

As you can see, days with an event have a blue circle for background... Ugly but enough with my graphic abilities. And when you click on a day in the calendar, korganizer opens itself on this day...
The patch is really simple and can be found here :
For the compilation, I tried to understand. Well, I hope I'm not too wrong in the explanations :
1- download kdebase-3.5.7 (may work with another kdebase... may not work... who knows...)
2- extract
3- go into the subfolder kicker/applets/clock and apply the patch (typ : patch -p1 < ~/clock_applet.patch for instance)
4- go back into the "root" of kdebase-3.5.7
5- launch ./configure
6- launch automake-1.9 (or if somebody still has hairs, he can look at this and explain how to do it the right way)
7- since you don't want to waste your CPU to compile the whole kdebase stuff compile with the following commands :
8- cd kicker/libkicker
9- make
10- cd ../applets/clock
11- make
12- make install as root.
Then you can relaunch kicker using the command dcop kicker Panel restart. Et voila...
You've got an ugly-looking integration between Korganizer and the clock applet, with a dependency on kdepim for a kdebase applet... Since kdepim is splitted with kdepimlibs, I hope it has already been done in KDE4... (I don't use korganizer so I didn't test this yet)

Any comment, feature request... can be written here. But don't expect every feature request to be accepted and worked on : I consider this as a waste of time...


Anonymous said...

note that single left click on a day in the calendar is originally meant to select a day, whose date can than be copied to the clipboard in the lineedit below.
this conflicts with opening korganizer on a left click, of course ;)

Anonymous said...

This lack of integration was one of the very few things that GNOME were doing better than KDE.
Good Work.

Pinaraf said...

I just don't understand why you would copy the date to the clipboard... That seems useless to me. If somebody want another behaviour, he can write his own patch :)

mesamoo said...

Thankyou Thankyou Thankyou
I never understood why this isn't the default behaviour

Pinaraf said...

That's not default because kdebase can't depend on kdepim I suppose. Moreover, it's too late to change this in KDE 3.5...

Kompressor said...

thank you
This kind of integration was long due and I appreciate the fact that you've explored this idea even if it may well be ugly :)
Good work.

Tobias Koenig said...


to avoid this strange 'system("korganizer")' hack you should use
KDCOPServiceStarter::self()->findServiceFor( "DCOP/Organizer", QString(), QString(), &error, &dcopService )
instead. This will look for the executable which provides this service (only KOrganizer at the moment) and start it.


Pinaraf said...

Hi Tobias

Thanks for this tip, I'll update the patch later...

Anonymous said...

The usual method for highlighting something as being interesting on a particular day, without being ugly, is to have bold text. Simply make the day bold if there is something interesting.

Hrw said...

Patched clock applet looks nice but have bugs:

- multiple days events are shown only for first day
- each clock open on my Debian 'sid' box gives:

QGDict::hashKeyString: Invalid null key
QGDict::hashKeyString: Invalid null key
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20
Minor opcode: 0
Resource id: 0x1801f41
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 19
Minor opcode: 0
Resource id: 0x1801f41
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20
Minor opcode: 0
Resource id: 0x1801f41
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20
Minor opcode: 0
Resource id: 0x1801f41

Pinaraf said...

For anonymous, about the bold font :
There is no way to easily change the font of one QDate in the KDateTable. I'd have to create a new class inheriting from KDateTable, that'd be quite a lot of work compared to this small simple hack.

For hrw :
I was aware of the first bug about the duration not considered. I'll try to fix it... But I don't know what to do about these X errors.

Anonymous said...

Check for availability of KOrganizer and then submit this patch to upstream. It definitely makes sense to have this in standard KDE.

Anonymous said...

This is very useful. I think the next step should be to define a standardized "open date"-interface, perhaps using DBUS, to use with this. Probably in conjunction with Freedesktop. This to accomplish several things:

- Be able to open another calendar than Korganizer for the date
- Be able to open Korganizer (or other calendar apps) from a web browser that recognizes microformats. Microformats recognizition will likely be a new feature in Firefox 3.

malte said...

Youre my hero.