toggleDesktopImmutability -> pimpl

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801134
This commit is contained in:
Aaron J. Seigo 2008-04-25 19:15:50 +00:00
parent 4d6ab4bb1a
commit c5e0d52ac3
3 changed files with 27 additions and 26 deletions

View File

@ -479,25 +479,6 @@ Location Containment::location() const
return d->location;
}
void Containment::toggleDesktopImmutability()
{
if (corona()) {
if (corona()->immutability() == NotImmutable) {
corona()->setImmutability(UserImmutable);
} else if (corona()->immutability() == UserImmutable) {
corona()->setImmutability(NotImmutable);
}
} else {
if (immutability() == NotImmutable) {
setImmutability(UserImmutable);
} else if (immutability() == UserImmutable) {
setImmutability(NotImmutable);
}
}
d->setLockToolText();
}
void Containment::addSiblingContainment()
{
emit addSiblingContainment(this);
@ -894,6 +875,25 @@ void Containment::closeToolBox()
// Private class implementation
void Containment::Private::toggleDesktopImmutability()
{
if (q->corona()) {
if (q->corona()->immutability() == NotImmutable) {
q->corona()->setImmutability(UserImmutable);
} else if (q->corona()->immutability() == UserImmutable) {
q->corona()->setImmutability(NotImmutable);
}
} else {
if (q->immutability() == NotImmutable) {
q->setImmutability(UserImmutable);
} else if (q->immutability() == UserImmutable) {
q->setImmutability(NotImmutable);
}
}
setLockToolText();
}
void Containment::Private::zoomIn()
{
emit q->zoomRequested(q, Plasma::ZoomIn);

View File

@ -333,13 +333,6 @@ 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();
/**
* Tells the corona to create a new desktop containment
*/
@ -383,6 +376,7 @@ class PLASMA_EXPORT Containment : public Applet
Q_PRIVATE_SLOT(d, void positionToolBox())
Q_PRIVATE_SLOT(d, void zoomIn())
Q_PRIVATE_SLOT(d, void zoomOut())
Q_PRIVATE_SLOT(d, void toggleDesktopImmutability());
friend class Applet;
class Private;

View File

@ -72,6 +72,13 @@ public:
void zoomIn();
void zoomOut();
/**
* 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();
Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(),
const QRectF &geometry = QRectF(-1, -1, -1, -1), uint id = 0,
bool delayedInit = false);