neat bug: changing Activity type while widgets are locked caused Appearances settings to be permahidden. chased out a few other ways to trigger this once that one was fixed, works nicely now.

BUG:180887

svn path=/trunk/KDE/kdelibs/; revision=911727
This commit is contained in:
Aaron J. Seigo 2009-01-16 00:39:07 +00:00
parent 8056505aa0
commit 4bc508411a
2 changed files with 17 additions and 8 deletions

View File

@ -923,11 +923,13 @@ void Applet::flushPendingConstraintsEvents()
action->setVisible(unlocked);
action->setEnabled(unlocked);
}
if (!KAuthorized::authorize("PlasmaAllowConfigureWhenLocked")) {
bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked");
if (canConfig) {
action = d->actions.action("configure");
if (action) {
action->setVisible(unlocked);
action->setEnabled(unlocked);
action->setVisible(canConfig);
action->setEnabled(canConfig);
}
}
}
@ -1282,6 +1284,10 @@ void Applet::setHasConfigurationInterface(bool hasInterface)
configAction = new QAction(i18n("%1 Settings", name()), this);
configAction->setIcon(KIcon("configure"));
configAction->setShortcutContext(Qt::WidgetShortcut); //don't clash with other views
bool unlocked = immutability() == Mutable;
bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked");
configAction->setVisible(canConfig);
configAction->setEnabled(canConfig);
if (isContainment()) {
//kDebug() << "I am a containment";
configAction->setShortcut(QKeySequence("ctrl+shift+s"));

View File

@ -153,8 +153,9 @@ void Containment::init()
QAction *configureActivityAction = new QAction(i18n("Appearance Settings"), this);
configureActivityAction->setIcon(KIcon("configure"));
configureActivityAction->setVisible(unlocked);
configureActivityAction->setEnabled(unlocked);
bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked");
configureActivityAction->setVisible(canConfig);
configureActivityAction->setEnabled(canConfig);
connect(configureActivityAction, SIGNAL(triggered()), this, SLOT(requestConfiguration()));
d->actions().addAction("activity settings", configureActivityAction);
@ -1599,11 +1600,13 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
action->setText(unlocked ? i18n("Lock Widgets") : i18n("Unlock Widgets"));
action->setIcon(KIcon(unlocked ? "object-locked" : "object-unlocked"));
}
if (!KAuthorized::authorize("PlasmaAllowConfigureWhenLocked")) {
bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked");
if (canConfig) {
action = actions().action("activity settings");
if (action) {
action->setVisible(unlocked);
action->setEnabled(unlocked);
action->setVisible(canConfig);
action->setEnabled(canConfig);
}
}