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 tha

t one was fixed, works nicely now.
CCBUG:180887

svn path=/branches/KDE/4.2/kdelibs/; revision=911730
This commit is contained in:
Aaron J. Seigo 2009-01-16 00:43:16 +00:00
parent 2be355b79d
commit c79e301e5c
2 changed files with 17 additions and 8 deletions

View File

@ -897,11 +897,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);
}
}
}
@ -1256,6 +1258,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);
}
}