stuff needed for configuration of plugins

svn path=/trunk/KDE/kdelibs/; revision=1012641
This commit is contained in:
Chani Armitage 2009-08-17 22:30:54 +00:00
parent 9d2a2e40ba
commit d82fe71821
3 changed files with 13 additions and 2 deletions

View File

@ -1727,7 +1727,8 @@ void Containment::setContextAction(const QString &trigger, const QString &plugin
if (action) { if (action) {
if (action->isInitialized()) { if (action->isInitialized()) {
KConfigGroup actionConfig = KConfigGroup(&cfg, trigger); //FIXME make a truly unique config group
KConfigGroup actionConfig = KConfigGroup(&cfg, pluginName);
action->restore(actionConfig); action->restore(actionConfig);
} }
action->setParent(this); action->setParent(this);
@ -2269,7 +2270,7 @@ bool ContainmentPrivate::prepareContextAction(const QString &trigger, const QPoi
if (!action->isInitialized()) { if (!action->isInitialized()) {
KConfigGroup cfg(&(q->config()), "ContextActions"); KConfigGroup cfg(&(q->config()), "ContextActions");
KConfigGroup actionConfig = KConfigGroup(&cfg, trigger); KConfigGroup actionConfig = KConfigGroup(&cfg, action->pluginName());
action->restore(actionConfig); action->restore(actionConfig);
} }

View File

@ -182,6 +182,11 @@ QWidget *ContextAction::createConfigurationInterface(QWidget *parent)
return 0; return 0;
} }
void ContextAction::configurationAccepted()
{
//do nothing by default
}
void ContextAction::contextEvent(QGraphicsSceneMouseEvent *event) void ContextAction::contextEvent(QGraphicsSceneMouseEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)

View File

@ -153,6 +153,11 @@ class PLASMA_EXPORT ContextAction : public QObject
*/ */
virtual QWidget *createConfigurationInterface(QWidget *parent); virtual QWidget *createConfigurationInterface(QWidget *parent);
/**
* This method is called when the user's configuration changes are accepted
*/
virtual void configurationAccepted();
/** /**
* Implement this to respond to a mouse button event. * Implement this to respond to a mouse button event.
* The user can configure whatever button and modifier they like, so please don't look at * The user can configure whatever button and modifier they like, so please don't look at