diff --git a/containment.cpp b/containment.cpp index 5e6416b19..c5db1e990 100644 --- a/containment.cpp +++ b/containment.cpp @@ -208,6 +208,11 @@ void Containment::setContainmentType(Containment::Type type) Plasma::Widget *zoomOutTool = addToolBoxTool("zoomOut", "zoom-out", i18n("Zoom Out")); connect(zoomOutTool, SIGNAL(clicked()), this, SIGNAL(zoomOut())); + + //FIXME how do we access the widget later to change it between lock and unlock? + //FIXME only show if user's allowed to toggle + //Plasma::Widget *lockTool = addToolBoxTool("lockWidgets", "object-locked", i18n("Lock Widgets")); + //connect(lockTool, SIGNAL(clicked()), this, SLOT(toggleDesktopImmutability())); } } else { delete d->toolbox; @@ -418,6 +423,15 @@ Location Containment::location() const return d->location; } +void Containment::toggleDesktopImmutability() +{ + if (corona()) { + corona()->setImmutable(!corona()->isImmutable()); + } else { + setImmutable(!isImmutable()); + } +} + void Containment::clearApplets() { qDeleteAll(d->applets); @@ -705,7 +719,7 @@ void Containment::setScreen(int screen) if (screen < -1) { screen = -1; } - +//FIXME several blatant bugs here //kDebug() << "setting screen to " << screen << "and type is" << containmentType(); if (screen < numScreens && screen > -1) { QRect r = desktop->screenGeometry(screen); diff --git a/containment.h b/containment.h index b59140d3c..515761647 100644 --- a/containment.h +++ b/containment.h @@ -331,6 +331,13 @@ class PLASMA_EXPORT Containment : public Applet */ void setFormFactor(Plasma::FormFactor formFactor); + /** + * Locks or unlocks plasma's applets. + * When plasma is locked, applets cannot be transformed, added or deleted + * but they can still be configured. + */ + void toggleDesktopImmutability(); + /** * Returns the Corona (if any) that this Containment is hosted by */