Clocks context menu to fast copying date and time

Emdek emdeck at gmail.com
Tue Mar 31 13:05:32 CEST 2009


Hello

So I've finally started using this mailing list so I would like to post here some of my ideas that accumulated for some time...

Some time ago I've created wish on BKO:
https://bugs.kde.org/show_bug.cgi?id=173162

I'm still interested in working on this topic, and I've plans how it could be achieved.
Firstly there could be added default contextualActions() to ClockApplet. It would return by default one action, lets name it clipboardMenu.
This action contains menu connected to it.
The hovered() signal of this action could be connected to not public slot (or public, then it could be used by developers that want to supply own formats, like me), lets name it updateClipboardMenu().
That slot would update actions in that menu, removing or updating all actions in it using for example loop with list of predefined date and time formats (this list should differ from that in KDE3, it produced often duplicated entries).
It would use dataEngine("time")->query(currentTimezone()) for getting current date and time (so there is no problem if clock is updated in interval other than one second).
Every action would be connected (for example trigerred(QAction*) signal) to not public slot (could be named copyToClipboard()) for copying string from action to clipboard, using QApplication::clipboard()->setText(action->text()).

If developers are interested and there is no objections I could try to create patch during this or next weekend. I'm already using this code in my applet for nearly half of year and it doesn't make any problems.

There is only one problem, I don't have KDE from SVN and currently I don't have time to get it, so I would need someone to test it (writing it's not a problem for me).

By the way, there is one virtual method that could be probably implemented in lib, because it probably will look the same in 95% of clock applets (I've noticed it when I was investigating why using wheel in my applet doesn't change time zone), I'm talking about this method:
virtual void changeEngineTimezone(const QString &oldTimezone, const QString &newTimezone)


Best regards
Michał




More information about the Plasma-devel mailing list