make it possible to remove panels again

svn path=/trunk/KDE/kdelibs/; revision=892648
This commit is contained in:
Aaron J. Seigo 2008-12-04 20:34:04 +00:00
parent e377d738ec
commit 2207ff1dc5

View File

@ -394,6 +394,11 @@ void Containment::setContainmentType(Containment::Type type)
if ((type == DesktopContainment || type == PanelContainment)) {
d->createToolBox();
}
enableAction("remove", (immutability() == Mutable &&
(screen() == -1 ||
containmentType() == Plasma::Containment::PanelContainment ||
containmentType() == Plasma::Containment::CustomPanelContainment)));
}
Corona *Containment::corona() const
@ -827,8 +832,10 @@ void Containment::setScreen(int screen, int desktop)
swapScreensWith->setScreen(oldScreen);
}
if (immutability() == Mutable && containmentType() != Plasma::Containment::PanelContainment) {
enableAction("remove", screen == -1);
if (immutability() == Mutable) {
enableAction("remove", screen == -1 ||
containmentType() != Plasma::Containment::PanelContainment ||
containmentType() != Plasma::Containment::CustomPanelContainment);
}
}
@ -1618,7 +1625,10 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
if (toolBox && constraints & Plasma::StartupCompletedConstraint) {
toolBox->addTool(q->action("remove"));
q->enableAction("remove", (q->immutability() == Mutable && q->containmentType() == Plasma::Containment::PanelContainment));
q->enableAction("remove", (q->immutability() == Mutable &&
(screen == -1 ||
q->containmentType() == Plasma::Containment::PanelContainment ||
q->containmentType() == Plasma::Containment::CustomPanelContainment)));
}
}