avialableWidgets

svn path=/trunk/KDE/kdebase/workspace/; revision=1119853
This commit is contained in:
Aaron J. Seigo 2010-04-27 20:26:21 +00:00 committed by Marco Martin
parent fa83ab3f21
commit 9fe0a6d34f
2 changed files with 16 additions and 0 deletions

View File

@ -189,6 +189,20 @@ QScriptValue ScriptEngine::panelById(QScriptContext *context, QScriptEngine *eng
return engine->undefinedValue();
}
QScriptValue ScriptEngine::availableWidgets(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(context)
QStringList widgets;
KPluginInfo::List info = Plasma::Applet::listAppletInfo();
foreach (const KPluginInfo &info, info) {
widgets.append(info.pluginName());
}
return qScriptValueFromValue(engine, widgets);
}
QScriptValue ScriptEngine::activities(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(context)
@ -314,6 +328,7 @@ void ScriptEngine::setupEngine()
m_scriptSelf.setProperty("QRectF", constructQRectFClass(this));
m_scriptSelf.setProperty("Activity", newFunction(ScriptEngine::newActivity));
m_scriptSelf.setProperty("Panel", newFunction(ScriptEngine::newPanel));
m_scriptSelf.setProperty("availableWidgets", newFunction(ScriptEngine::availableWidgets));
m_scriptSelf.setProperty("activities", newFunction(ScriptEngine::activities));
m_scriptSelf.setProperty("activityById", newFunction(ScriptEngine::activityById));
m_scriptSelf.setProperty("activityForScreen", newFunction(ScriptEngine::activityForScreen));

View File

@ -62,6 +62,7 @@ private:
void setupEngine();
// containment accessors
static QScriptValue availableWidgets(QScriptContext *context, QScriptEngine *engine);
static QScriptValue newActivity(QScriptContext *context, QScriptEngine *engine);
static QScriptValue newPanel(QScriptContext *context, QScriptEngine *engine);
static QScriptValue activities(QScriptContext *context, QScriptEngine *engine);