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
This commit is contained in:
Aaron J. Seigo 2008-09-10 18:51:30 +00:00
parent bf942582e8
commit c633c8ac57
3 changed files with 12 additions and 1 deletions

View File

@ -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;
}

View File

@ -1391,6 +1391,12 @@ void Containment::destroy(bool confirm)
}
}
void Containment::showConfigurationInterface()
{
if (isContainment()) {
emit configureRequested();
}
}
// Private class implementation

View File

@ -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.