From c633c8ac57d9bbb35012fadb39071ae5fe46372e Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 10 Sep 2008 18:51:30 +0000 Subject: [PATCH] hook up the containment configuration interface to the generic containment configuration mechanism; now it shows in the toolbox too! whee! svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=859593 --- applet.cpp | 3 ++- containment.cpp | 6 ++++++ containment.h | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/applet.cpp b/applet.cpp index 8a0fec27a..d4fd2c6cf 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1078,7 +1078,7 @@ void Applet::setHasConfigurationInterface(bool hasInterface) //TODO respect security when it's implemented (4.2) QAction *configAction = d->actions.action("configure"); if (hasInterface) { - if (! configAction) { //should be always true + if (!configAction) { //should be always true configAction = new QAction(i18n("%1 Settings", name()), this); configAction->setIcon(KIcon("configure")); configAction->setShortcutContext(Qt::WidgetShortcut); //don't clash with other views @@ -1182,6 +1182,7 @@ void Applet::showConfigurationInterface() if (!hasConfigurationInterface()) { return; } + if (immutability() != Mutable && !KAuthorized::authorize("PlasmaAllowConfigureWhenLocked")) { return; } diff --git a/containment.cpp b/containment.cpp index f375933c1..9cbe7b9da 100644 --- a/containment.cpp +++ b/containment.cpp @@ -1391,6 +1391,12 @@ void Containment::destroy(bool confirm) } } +void Containment::showConfigurationInterface() +{ + if (isContainment()) { + emit configureRequested(); + } +} // Private class implementation diff --git a/containment.h b/containment.h index 6e7cfbd42..2e75f6f9a 100644 --- a/containment.h +++ b/containment.h @@ -426,6 +426,10 @@ class PLASMA_EXPORT Containment : public Applet */ void destroy(bool confirm); + /** + * @reimplemented from Plasma::Applet + */ + void showConfigurationInterface(); protected: /** * Sets the type of this containment.