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:
parent
8056505aa0
commit
4bc508411a
12
applet.cpp
12
applet.cpp
@ -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"));
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user