panels()
svn path=/trunk/KDE/kdebase/workspace/; revision=1119751
This commit is contained in:
parent
2fb92df68c
commit
62af47f1de
@ -188,6 +188,25 @@ QScriptValue ScriptEngine::panelById(QScriptContext *context, QScriptEngine *eng
|
||||
return engine->undefinedValue();
|
||||
}
|
||||
|
||||
QScriptValue ScriptEngine::panels(QScriptContext *context, QScriptEngine *engine)
|
||||
{
|
||||
Q_UNUSED(context)
|
||||
|
||||
QScriptValue panels = engine->newArray();
|
||||
ScriptEngine *env = envFor(engine);
|
||||
int count = 0;
|
||||
|
||||
foreach (Plasma::Containment *c, env->m_corona->containments()) {
|
||||
if (isPanel(c)) {
|
||||
panels.setProperty(count, env->wrap(c));
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
panels.setProperty("length", count);
|
||||
return panels;
|
||||
}
|
||||
|
||||
QScriptValue ScriptEngine::fileExists(QScriptContext *context, QScriptEngine *engine)
|
||||
{
|
||||
Q_UNUSED(engine)
|
||||
@ -278,6 +297,7 @@ void ScriptEngine::setupEngine()
|
||||
m_scriptSelf.setProperty("activityById", newFunction(ScriptEngine::activityById));
|
||||
m_scriptSelf.setProperty("activityForScreen", newFunction(ScriptEngine::activityForScreen));
|
||||
m_scriptSelf.setProperty("panelById", newFunction(ScriptEngine::panelById));
|
||||
m_scriptSelf.setProperty("panels", newFunction(ScriptEngine::panels));
|
||||
m_scriptSelf.setProperty("fileExists", newFunction(ScriptEngine::fileExists));
|
||||
m_scriptSelf.setProperty("loadTemplate", newFunction(ScriptEngine::loadTemplate));
|
||||
m_scriptSelf.setProperty("applicationVersion", KGlobal::mainComponent().aboutData()->version(), QScriptValue::ReadOnly | QScriptValue::Undeletable);
|
||||
|
@ -67,6 +67,7 @@ private:
|
||||
static QScriptValue activityById(QScriptContext *context, QScriptEngine *engine);
|
||||
static QScriptValue activityForScreen(QScriptContext *context, QScriptEngine *engine);
|
||||
static QScriptValue panelById(QScriptContext *context, QScriptEngine *engine);
|
||||
static QScriptValue panels(QScriptContext *context, QScriptEngine *engine);
|
||||
static QScriptValue fileExists(QScriptContext *context, QScriptEngine *engine);
|
||||
static QScriptValue loadTemplate(QScriptContext *context, QScriptEngine *engine);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user