update the lock action once, instead of having every containment do it

svn path=/trunk/KDE/kdelibs/; revision=938042
This commit is contained in:
Chani Armitage 2009-03-11 04:46:13 +00:00
parent 14869d0fb8
commit 9af884bad7
2 changed files with 8 additions and 5 deletions

View File

@ -1599,11 +1599,6 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
action->setVisible(unlocked);
action->setEnabled(unlocked);
}*/
QAction *action = actions().action("lock widgets");
if (action) {
action->setText(unlocked ? i18n("Lock Widgets") : i18n("Unlock Widgets"));
action->setIcon(KIcon(unlocked ? "object-locked" : "object-unlocked"));
}
// tell the applets too
foreach (Applet *a, applets) {

View File

@ -567,6 +567,14 @@ void Corona::setImmutability(const ImmutabilityType immutable)
d->immutability = immutable;
d->updateContainmentImmutability();
//update our actions
bool unlocked = d->immutability == Mutable;
QAction *action = d->actions.action("lock widgets");
if (action) {
action->setText(unlocked ? i18n("Lock Widgets") : i18n("Unlock Widgets"));
action->setIcon(KIcon(unlocked ? "object-locked" : "object-unlocked"));
}
KConfigGroup cg(config(), "General");
// we call the dptr member directly for locked since isImmutable()