Add lockWidgets to containment interface

This commit is contained in:
Sebastian Kügler 2013-08-13 04:19:13 +02:00
parent 0859a1fe58
commit 0b5d791e2b
2 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include <QDebug> #include <QDebug>
#include <KLocalizedString> #include <KLocalizedString>
#include <plasma.h>
#include <Plasma/ContainmentActions> #include <Plasma/ContainmentActions>
#include <Plasma/Corona> #include <Plasma/Corona>
#include <Plasma/Package> #include <Plasma/Package>
@ -120,6 +121,12 @@ int ContainmentInterface::screen() const
return containment()->screen(); return containment()->screen();
} }
void ContainmentInterface::lockWidgets(bool locked)
{
containment()->setImmutability(!locked ? Plasma::Types::Mutable : Plasma::Types::UserImmutable);
emit immutableChanged();
}
QRectF ContainmentInterface::screenGeometry(int id) const QRectF ContainmentInterface::screenGeometry(int id) const
{ {
QRectF rect; QRectF rect;

View File

@ -66,6 +66,7 @@ public:
QString activity() const; QString activity() const;
Q_INVOKABLE void lockWidgets(bool locked);
Q_INVOKABLE QRectF screenGeometry(int id) const; Q_INVOKABLE QRectF screenGeometry(int id) const;
Q_INVOKABLE QVariantList availableScreenRegion(int id) const; Q_INVOKABLE QVariantList availableScreenRegion(int id) const;
@ -84,6 +85,7 @@ Q_SIGNALS:
void activityChanged(); void activityChanged();
void availableScreenRegionChanged(); void availableScreenRegionChanged();
void appletsChanged(); void appletsChanged();
///void immutableChanged();
protected Q_SLOTS: protected Q_SLOTS:
void appletAddedForward(Plasma::Applet *applet); void appletAddedForward(Plasma::Applet *applet);