move toggleDesktopImmutability() from defaultdesktop to containment

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=781623
This commit is contained in:
Chani Armitage 2008-03-03 11:44:40 +00:00
parent 92a724abe3
commit 34ae05a9b2
2 changed files with 22 additions and 1 deletions

View File

@ -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);

View File

@ -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
*/