the scriptengine has an uiReady property

will be used for some experiments later: we can track if the ui
machinery has been correctly initialized.
we'll use that to ensure the applets gets initialized and prepared only
after their containment has been
This commit is contained in:
Marco Martin 2013-08-08 16:12:31 +02:00
parent 279c622b27
commit 9b52bfad89
3 changed files with 23 additions and 1 deletions

View File

@ -185,6 +185,7 @@ void AppletInterface::init()
} }
geometryChanged(QRectF(), QRectF(x(), y(), width(), height())); geometryChanged(QRectF(), QRectF(x(), y(), width(), height()));
emit busyChanged(); emit busyChanged();
m_appletScriptEngine->setUiReady(true);
} }
Plasma::Types::FormFactor AppletInterface::formFactor() const Plasma::Types::FormFactor AppletInterface::formFactor() const

View File

@ -56,7 +56,8 @@ K_EXPORT_PLASMA_APPLETSCRIPTENGINE(declarativeappletscript, DeclarativeAppletScr
DeclarativeAppletScript::DeclarativeAppletScript(QObject *parent, const QVariantList &args) DeclarativeAppletScript::DeclarativeAppletScript(QObject *parent, const QVariantList &args)
: Plasma::AppletScript(parent), : Plasma::AppletScript(parent),
m_interface(0) m_interface(0),
m_uiReady(false)
{ {
qmlRegisterType<AppletInterface>(); qmlRegisterType<AppletInterface>();
qmlRegisterType<ConfigPropertyMap>(); qmlRegisterType<ConfigPropertyMap>();
@ -114,6 +115,21 @@ void DeclarativeAppletScript::constraintsEvent(Plasma::Types::Constraints constr
} }
} }
void DeclarativeAppletScript::setUiReady(bool ready)
{
if (m_uiReady == ready) {
return;
}
m_uiReady = ready;
emit uiReadyChanged(ready);
}
bool DeclarativeAppletScript::isUiReady() const
{
return m_uiReady;
}
void DeclarativeAppletScript::activate() void DeclarativeAppletScript::activate()
{ {
#if 0 #if 0

View File

@ -45,6 +45,9 @@ public:
void constraintsEvent(Plasma::Types::Constraints constraints); void constraintsEvent(Plasma::Types::Constraints constraints);
void setUiReady(bool ready);
bool isUiReady() const;
public Q_SLOTS: public Q_SLOTS:
void executeAction(const QString &name); void executeAction(const QString &name);
void activate(); void activate();
@ -56,9 +59,11 @@ Q_SIGNALS:
void formFactorChanged(); void formFactorChanged();
void locationChanged(); void locationChanged();
void contextChanged(); void contextChanged();
void uiReadyChanged(bool ready);
private: private:
AppletInterface *m_interface; AppletInterface *m_interface;
bool m_uiReady;
friend class AppletInterface; friend class AppletInterface;
}; };