Enables ScriptEngine's like Apple's Dashboard Widgets or SuperKaramba's to implement containments too. Right, that means you are now able to write your own Panel or even Desktop using a scripting language :)
FEATURE svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=782729
This commit is contained in:
parent
afdb5e84a0
commit
1420d4ba60
@ -222,6 +222,7 @@ endif(QT_QTOPENGL_FOUND AND OPENGL_FOUND)
|
|||||||
install(FILES
|
install(FILES
|
||||||
servicetypes/plasma-animator.desktop
|
servicetypes/plasma-animator.desktop
|
||||||
servicetypes/plasma-applet.desktop
|
servicetypes/plasma-applet.desktop
|
||||||
|
servicetypes/plasma-containment.desktop
|
||||||
servicetypes/plasma-dataengine.desktop
|
servicetypes/plasma-dataengine.desktop
|
||||||
servicetypes/plasma-packagestructure.desktop
|
servicetypes/plasma-packagestructure.desktop
|
||||||
servicetypes/plasma-runner.desktop
|
servicetypes/plasma-runner.desktop
|
||||||
|
11
applet.cpp
11
applet.cpp
@ -1359,11 +1359,16 @@ Applet* Applet::load(const QString& appletName, uint appletId, const QVariantLis
|
|||||||
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName);
|
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName);
|
||||||
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
|
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
|
||||||
|
|
||||||
|
bool isContainment = false;
|
||||||
if (offers.isEmpty()) {
|
if (offers.isEmpty()) {
|
||||||
//TODO: what would be -really- cool is offer to try and download the applet
|
//TODO: what would be -really- cool is offer to try and download the applet
|
||||||
// from the network at this point
|
// from the network at this point
|
||||||
|
offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint);
|
||||||
|
isContainment = true;
|
||||||
|
if (!offers.isEmpty()) {
|
||||||
kDebug() << "offers is empty for " << appletName;
|
kDebug() << "offers is empty for " << appletName;
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
} /* else if (offers.count() > 1) {
|
} /* else if (offers.count() > 1) {
|
||||||
kDebug() << "hey! we got more than one! let's blindly take the first one";
|
kDebug() << "hey! we got more than one! let's blindly take the first one";
|
||||||
} */
|
} */
|
||||||
@ -1376,8 +1381,10 @@ Applet* Applet::load(const QString& appletName, uint appletId, const QVariantLis
|
|||||||
|
|
||||||
if (!offer->property("X-Plasma-Language").toString().isEmpty()) {
|
if (!offer->property("X-Plasma-Language").toString().isEmpty()) {
|
||||||
kDebug() << "we have a script in the language of" << offer->property("X-Plasma-Language").toString();
|
kDebug() << "we have a script in the language of" << offer->property("X-Plasma-Language").toString();
|
||||||
Applet *applet = new Applet(0, offer->storageId(), appletId);
|
if (isContainment) {
|
||||||
return applet;
|
return new Containment(0, offer->storageId(), appletId);
|
||||||
|
}
|
||||||
|
return new Applet(0, offer->storageId(), appletId);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantList allArgs;
|
QVariantList allArgs;
|
||||||
|
@ -312,7 +312,9 @@ bool Package::registerPackage(const PackageMetadata &data, const QString &iconPa
|
|||||||
KDesktopFile config(service);
|
KDesktopFile config(service);
|
||||||
KConfigGroup cg = config.desktopGroup();
|
KConfigGroup cg = config.desktopGroup();
|
||||||
cg.writeEntry("Type", "Service");
|
cg.writeEntry("Type", "Service");
|
||||||
cg.writeEntry("X-KDE-ServiceTypes", "Plasma/Applet");
|
//TODO do we really like to just install all packages as applet/containment? Probably
|
||||||
|
//it would make sense to let the packages themself decide what they are.
|
||||||
|
cg.writeEntry("X-KDE-ServiceTypes", "Plasma/Applet,Plasma/Containment");
|
||||||
cg.writeEntry("X-KDE-PluginInfo-EnabledByDefault", true);
|
cg.writeEntry("X-KDE-PluginInfo-EnabledByDefault", true);
|
||||||
|
|
||||||
QFile icon(iconPath);
|
QFile icon(iconPath);
|
||||||
|
Loading…
Reference in New Issue
Block a user