[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    [PATCH] Support for PopupApplets in Python
From:       Luca Beltrame <einar () heavensinferno ! net>
Date:       2010-02-20 22:38:55
Message-ID: 201002202338.58767.einar () heavensinferno ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Hello,

as I said, I've been trying to hack in support for PopupApplets in Python. 
This patch is a first version of such a thing, which at least enables the 
proper binding when used scripted applets.

It needs some review, as I'm unfamiliar on how PopupApplets work, and if I'm 
doing the right thing (still new at these things), especially the Python 
bindings people (Simon, which is CCed here).  The initializing code is a cut 
and copy paste from Applet, just modified to accept extra arguments.

It works, or seems to work. I haven't been able to test it for real as there 
is no clean, simple PopupApplet implementation which I could use as reference.

In any case, comments welcome.

["python_popupapplet.patch" (text/x-patch)]

Index: plasmascript.py
===================================================================
--- plasmascript.py	(revision 1093442)
+++ plasmascript.py	(working copy)
@@ -98,6 +98,21 @@
     def saveState(self, config):
         pass
 
+class PopupApplet(Applet):
+
+    def __init__(self, parent=None, *args):
+        # this should be set when the applet is created
+        Applet.__init__(self, parent, *args)
+        self.applet = None
+        self.applet_script = None
+        self._forward_to_applet = True
+
+    def graphicsWidget(self):
+        pass
+
+    def widget(self):
+        pass
+
 ###########################################################################
 class DataEngine(QObject):
     def __init__(self, parent=None):

["signature.asc" (application/pgp-signature)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic