[Kde-bindings] Python Plasma.PopupApplet revisited

Thomas Olsen tanghus at gmail.com
Mon Jul 5 21:05:27 UTC 2010


Hi

Inspired by Petri's example [1] I almost succeeded in creating a Python based 
PopupApplet without instantiating ExtenderItems. The only problem is that in 
order for the Applet to actually popup when clicked on in the panel, I have to 
first add it to the desktop and then drag it to the panel :-/

In metadata.desktop I have ServiceTypes=Plasma/PopupApplet.
I have overloaded graphicsWidget() which creates the GUI and widget() which 
simply calls graphicsWidget(). Had to use both of them because either I got a 
TypeError or neither got called. I also had to call setGraphicsWidget() and 
setPopupIcon(). All of this works excellent but only if the Plasmoid was first 
added to the desktop.
From reading the source of the C++ implementation [2] I can see that the 
panel-icon-widget's (or whatever it's called) clicked() signal gets connected 
to a private method internalTogglePopup() but for some reason that doesn't 
happen when it is added directly to the panel.

Am I missing something or will I have to reimplement everything in Python - 
which seems a bit silly ;-)

[1] http://websvn.kde.org/trunk/KDE/kdeexamples/plasma/python/applets/pyhello/
[2] http://websvn.kde.org/trunk/KDE/kdelibs/plasma/popupapplet.cpp?view=markup

PS: Sorry for the X-post but it kinda overlaps both lists.
PSS: Do say if you need actual code then I'll make a simplified example.

-- 
Best Regards / Med venlig hilsen

Thomas Olsen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20100705/03b9ba6b/attachment.sig>


More information about the Kde-bindings mailing list