allow telling the wallpaper that it is in previewing mode
BUG:229450 svn path=/trunk/KDE/kdelibs/; revision=1099127
This commit is contained in:
parent
3c262b40ea
commit
2ca8a1d2ee
@ -76,6 +76,7 @@ public:
|
|||||||
bool initialized : 1;
|
bool initialized : 1;
|
||||||
bool needsConfig : 1;
|
bool needsConfig : 1;
|
||||||
bool scriptInitialized : 1;
|
bool scriptInitialized : 1;
|
||||||
|
bool previewing : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LoadImageThread : public QObject, public QRunnable
|
class LoadImageThread : public QObject, public QRunnable
|
||||||
|
@ -459,7 +459,8 @@ WallpaperPrivate::WallpaperPrivate(KService::Ptr service, Wallpaper *wallpaper)
|
|||||||
cacheRendering(false),
|
cacheRendering(false),
|
||||||
initialized(false),
|
initialized(false),
|
||||||
needsConfig(false),
|
needsConfig(false),
|
||||||
scriptInitialized(false)
|
scriptInitialized(false),
|
||||||
|
previewing(false)
|
||||||
{
|
{
|
||||||
if (wallpaperDescription.isValid()) {
|
if (wallpaperDescription.isValid()) {
|
||||||
QString api = wallpaperDescription.property("X-Plasma-API").toString();
|
QString api = wallpaperDescription.property("X-Plasma-API").toString();
|
||||||
@ -638,6 +639,16 @@ void Wallpaper::setContextualActions(const QList<QAction*> &actions)
|
|||||||
contextActions = actions;
|
contextActions = actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Wallpaper::isPreviewing() const
|
||||||
|
{
|
||||||
|
return d->previewing;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Wallpaper::setPreviewing(bool previewing)
|
||||||
|
{
|
||||||
|
d->previewing = previewing;
|
||||||
|
}
|
||||||
|
|
||||||
const Package *Wallpaper::package() const
|
const Package *Wallpaper::package() const
|
||||||
{
|
{
|
||||||
return d->package;
|
return d->package;
|
||||||
|
12
wallpaper.h
12
wallpaper.h
@ -62,6 +62,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
|||||||
Q_PROPERTY(KServiceAction renderingMode READ renderingMode)
|
Q_PROPERTY(KServiceAction renderingMode READ renderingMode)
|
||||||
Q_PROPERTY(QList<KServiceAction> listRenderingModes READ listRenderingModes)
|
Q_PROPERTY(QList<KServiceAction> listRenderingModes READ listRenderingModes)
|
||||||
Q_PROPERTY(bool usingRenderingCache READ isUsingRenderingCache WRITE setUsingRenderingCache)
|
Q_PROPERTY(bool usingRenderingCache READ isUsingRenderingCache WRITE setUsingRenderingCache)
|
||||||
|
Q_PROPERTY(bool previewing READ isPreviewing WRITE setPreviewing)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -330,6 +331,17 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
|||||||
*/
|
*/
|
||||||
QList<QAction*> contextualActions() const;
|
QList<QAction*> contextualActions() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if in preview mode, such as in a configuation dialog
|
||||||
|
* @since 4.5
|
||||||
|
*/
|
||||||
|
bool isPreviewing() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Puts the wallpaper into preview mode
|
||||||
|
*/
|
||||||
|
void setPreviewing(bool previewing);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
/**
|
/**
|
||||||
* This signal indicates that wallpaper needs to be repainted.
|
* This signal indicates that wallpaper needs to be repainted.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user