Applet::isBusy() moved to scriptengine
the busy property is ui-specific, therefore goes only in the scriptengine
This commit is contained in:
parent
ea7a349656
commit
ec55761461
@ -372,16 +372,6 @@ void Applet::constraintsEvent(Plasma::Constraints constraints)
|
||||
}
|
||||
}
|
||||
|
||||
void Applet::setBusy(bool busy)
|
||||
{
|
||||
d->setBusy(busy);
|
||||
}
|
||||
|
||||
bool Applet::isBusy() const
|
||||
{
|
||||
return d->isBusy();
|
||||
}
|
||||
|
||||
QString Applet::title() const
|
||||
{
|
||||
if (!d->customTitle.isEmpty()) {
|
||||
|
@ -447,11 +447,6 @@ class PLASMA_EXPORT Applet : public QObject
|
||||
bool hasValidAssociatedApplication() const;
|
||||
|
||||
//Completely UI-specific, remove or move to scriptengine
|
||||
/**
|
||||
* @return true if the applet is busy and is showing an indicator widget for that
|
||||
*/
|
||||
bool isBusy() const;
|
||||
|
||||
/**
|
||||
* @return true if this plasmoid provides a GUI configuration
|
||||
**/
|
||||
@ -640,11 +635,6 @@ class PLASMA_EXPORT Applet : public QObject
|
||||
void runAssociatedApplication();
|
||||
|
||||
//Completely UI-specific, remove or move to scriptengine
|
||||
/**
|
||||
* Shows a busy indicator that overlays the applet
|
||||
* @param busy show or hide the busy indicator
|
||||
*/
|
||||
void setBusy(bool busy);
|
||||
|
||||
bool hasFocus() const;
|
||||
void setFocus(Qt::FocusReason);
|
||||
|
@ -189,18 +189,6 @@ void AppletPrivate::positionMessageOverlay()
|
||||
// reimplemented in the UI specific library
|
||||
}
|
||||
|
||||
void AppletPrivate::setBusy(bool busy)
|
||||
{
|
||||
// reimplemented in the UI specific library
|
||||
Q_UNUSED(busy)
|
||||
}
|
||||
|
||||
bool AppletPrivate::isBusy() const
|
||||
{
|
||||
// reimplemented in the UI specific library
|
||||
return false;
|
||||
}
|
||||
|
||||
void AppletPrivate::updateFailedToLaunch(const QString &reason)
|
||||
{
|
||||
// reimplemented in the UI specific library
|
||||
|
@ -41,7 +41,6 @@ class Dialog;
|
||||
class FrameSvg;
|
||||
class AppletScript;
|
||||
class Wallpaper;
|
||||
class BusyWidget;
|
||||
class PushButton;
|
||||
class Service;
|
||||
|
||||
@ -86,8 +85,6 @@ public:
|
||||
virtual void cleanUpAndDelete();
|
||||
virtual void showMessage(const QIcon &icon, const QString &message, const MessageButtons buttons);
|
||||
virtual void positionMessageOverlay();
|
||||
virtual void setBusy(bool busy);
|
||||
virtual bool isBusy() const;
|
||||
virtual void updateFailedToLaunch(const QString &reason);
|
||||
|
||||
// put all setup routines for script here. at this point we can assume that
|
||||
|
@ -46,7 +46,8 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, QQuickItem *pa
|
||||
: QQuickItem(parent),
|
||||
m_appletScriptEngine(script),
|
||||
m_actionSignals(0),
|
||||
m_backgroundHints(Plasma::StandardBackground)
|
||||
m_backgroundHints(Plasma::StandardBackground),
|
||||
m_busy(false)
|
||||
{
|
||||
qmlRegisterType<AppletInterface>();
|
||||
connect(this, SIGNAL(releaseVisualFocus()), applet(), SIGNAL(releaseVisualFocus()));
|
||||
@ -87,12 +88,17 @@ void AppletInterface::setFailedToLaunch(bool failed, const QString &reason)
|
||||
|
||||
bool AppletInterface::isBusy() const
|
||||
{
|
||||
return applet()->isBusy();
|
||||
return m_busy;
|
||||
}
|
||||
|
||||
void AppletInterface::setBusy(bool busy)
|
||||
{
|
||||
applet()->setBusy(busy);
|
||||
if (m_busy == busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_busy = busy;
|
||||
emit busyChanged();
|
||||
}
|
||||
|
||||
AppletInterface::BackgroundHints AppletInterface::backgroundHints() const
|
||||
|
@ -63,7 +63,7 @@ class AppletInterface : public QQuickItem
|
||||
Q_PROPERTY(Location location READ location NOTIFY locationChanged)
|
||||
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY contextChanged)
|
||||
Q_PROPERTY(QString activeConfig WRITE setActiveConfig READ activeConfig)
|
||||
Q_PROPERTY(bool busy WRITE setBusy READ isBusy)
|
||||
Q_PROPERTY(bool busy WRITE setBusy READ isBusy NOTIFY busyChanged)
|
||||
Q_PROPERTY(BackgroundHints backgroundHints WRITE setBackgroundHints READ backgroundHints NOTIFY backgroundHintsChanged)
|
||||
Q_PROPERTY(bool immutable READ immutable NOTIFY immutableChanged)
|
||||
Q_PROPERTY(bool userConfiguring READ userConfiguring) // @since 4.5
|
||||
@ -266,6 +266,7 @@ Q_SIGNALS:
|
||||
void immutableChanged();
|
||||
void statusChanged();
|
||||
void backgroundHintsChanged();
|
||||
void busyChanged();
|
||||
|
||||
protected:
|
||||
DeclarativeAppletScript *m_appletScriptEngine;
|
||||
@ -278,6 +279,7 @@ private:
|
||||
|
||||
//UI-specific properties
|
||||
Plasma::BackgroundHints m_backgroundHints;
|
||||
bool m_busy : 1;
|
||||
};
|
||||
|
||||
class JsAppletInterface : public AppletInterface
|
||||
|
Loading…
Reference in New Issue
Block a user