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

List:       kde-panel-devel
Subject:    Review Request: ScriptEngine's as Containments
From:       Sebastian Sauer <mail () dipe ! org>
Date:       2008-03-05 19:53:55
Message-ID: 200803052053.55769.mail () dipe ! org
[Download RAW message or body]

inspired by http://aseigo.blogspot.com/2008/03/power-of-containments.html :)

The attached patch does enable Containments (tested with panels) written using 
a ScriptEngine like SuperKaramba.

p.s. sorry for not using the review-board, I keep to get
'UploadDiffForm' object has no attribute 'cleaned_data'
erros on the try to create a new review request :-/

["ScriptEngineContainment.patch" (text/x-diff)]

Index: servicetypes/plasma-containment.desktop
===================================================================
--- servicetypes/plasma-containment.desktop	(revision 782420)
+++ servicetypes/plasma-containment.desktop	(working copy)
@@ -44,3 +44,5 @@
 Comment[zh_CN]=Plasma 小程序容器和背景绘制程序
 Comment[zh_TW]=Plasma 小程式容器與背景畫家
 
+[PropertyDef::X-Plasma-Language]
+Type=QString
Index: applet.cpp
===================================================================
--- applet.cpp	(revision 782420)
+++ applet.cpp	(working copy)
@@ -1359,11 +1359,14 @@
     QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName);
     KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
 
+bool isContainment = false;
     if (offers.isEmpty()) {
         //TODO: what would be -really- cool is offer to try and download the applet
         //      from the network at this point
         kDebug() << "offers is empty for " << appletName;
-        return 0;
+        offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint);
+        isContainment = true;
+        if(!offers.isEmpty()) return 0;
     } /* else if (offers.count() > 1) {
         kDebug() << "hey! we got more than one! let's blindly take the first one";
     } */
@@ -1376,6 +1379,8 @@
 
     if (!offer->property("X-Plasma-Language").toString().isEmpty()) {
         kDebug() << "we have a script in the language of" << offer->property("X-Plasma-Language").toString();
+        if (isContainment)
+           return new Containment(0, offer->storageId(), appletId);
         Applet *applet = new Applet(0, offer->storageId(), appletId);
         return applet;
     }
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 782420)
+++ CMakeLists.txt	(working copy)
@@ -222,6 +222,7 @@
 install(FILES
     servicetypes/plasma-animator.desktop
     servicetypes/plasma-applet.desktop
+    servicetypes/plasma-containment.desktop
     servicetypes/plasma-dataengine.desktop
     servicetypes/plasma-packagestructure.desktop
     servicetypes/plasma-runner.desktop


_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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