launch activation sanity: added it back to Corona since it is PUI relevant (and not just desktop specific), move the signal to Applet and chain them so that Applet -> Containment -> Corona

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801102
This commit is contained in:
Aaron J. Seigo 2008-04-25 17:21:24 +00:00
parent 282a18571b
commit a3ad7dca00
7 changed files with 24 additions and 43 deletions

View File

@ -943,13 +943,6 @@ void Applet::flushUpdatedConstraints()
}
}
void Applet::launchActivated()
{
if (containment()) {
containment()->emitLaunchActivated();
}
}
int Applet::type() const
{
return Type;
@ -1307,6 +1300,8 @@ void Applet::showConfigurationInterface()
dialog->show();
dialog->enableButtonApply(true);
}
emit launchActivated();
}
void Applet::createConfigurationInterface(KConfigDialog *parent)

View File

@ -523,6 +523,14 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
Containment* containment() const;
Q_SIGNALS:
/**
* This signal indicates that an application launch, window
* creation or window focus event was triggered. This is used, for instance,
* to ensure that the Dashboard view in Plasma hides when such an event is
* triggered by an item it is displaying.
*/
void launchActivated();
/**
* Emitted when the applet needs to take (or lose) keyboard focus.
*
@ -595,19 +603,13 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
* Causes this applet to lower below all the other applets.
*/
void lower();
/**
* Sends all pending contraints updates to the applet. Will usually
* be called automatically, but can also be called manually if needed.
*/
void flushUpdatedConstraints();
/**
* This method should be invoked whenever an application launch or other window
* creation of focussing event was triggered
*/
void launchActivated();
/**
* called when the Plasma::Theme has changed
*/

View File

@ -323,7 +323,6 @@ void AppletHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
case ConfigureButton:
//FIXME: Remove this call once the configuration management change was done
if (m_pressedButton == releasedAtButton) {
m_containment->emitLaunchActivated();
m_applet->showConfigurationInterface();
}
break;

View File

@ -713,11 +713,8 @@ Applet* Containment::Private::addApplet(const QString& name, const QVariantList&
//kDebug() << applet->name() << "sizehint:" << applet->sizeHint() << "geometry:" << applet->geometry();
Corona *c = q->corona();
if (c) {
connect(applet, SIGNAL(configNeedsSaving()), q->corona(), SLOT(scheduleConfigSync()));
}
connect(applet, SIGNAL(configNeedsSaving()), q, SIGNAL(configNeedsSaving()));
connect(applet, SIGNAL(launchActivated()), q, SIGNAL(launchActivated()));
q->addApplet(applet, appletGeometry.topLeft(), delayInit);
return applet;
}
@ -1272,12 +1269,6 @@ QVariant Containment::itemChange(GraphicsItemChange change, const QVariant &valu
return Applet::itemChange(change, value);
}
void Containment::emitLaunchActivated()
{
kDebug();
emit launchActivated();
}
QGraphicsWidget * Containment::addToolBoxTool(const QString& toolName, const QString& iconName, const QString& iconText)
{
Plasma::Icon *tool = new Plasma::Icon(this);

View File

@ -234,11 +234,6 @@ class PLASMA_EXPORT Containment : public Applet
*/
void loadContainment(KConfigGroup* group);
/**
* Emits the launchActivated() signal
*/
void emitLaunchActivated();
/**
* Constructs a toolbox item and adds it to the toolbox. The toolbox takes over ownership of the item. Returns the constructed tool.
*
@ -292,14 +287,6 @@ class PLASMA_EXPORT Containment : public Applet
*/
void appletRemoved(Plasma::Applet* applet);
/**
* This signal indicates that an application launch, window
* creation or window focus event was triggered. This is used, for instance,
* to ensure that the Dashboard view in Plasma hides when such an event is
* triggered by an item it is displaying.
*/
void launchActivated();
/**
* Emitted when the containment requests zooming in one step.
* Usually only used for desktop containments.

View File

@ -163,10 +163,9 @@ public:
}
containments.append(containment);
connect(containment, SIGNAL(destroyed(QObject*)),
q, SLOT(containmentDestroyed(QObject*)));
connect(containment, SIGNAL(configNeedsSaving()),
q, SLOT(scheduleConfigSync()));
connect(containment, SIGNAL(destroyed(QObject*)), q, SLOT(containmentDestroyed(QObject*)));
connect(containment, SIGNAL(configNeedsSaving()), q, SLOT(scheduleConfigSync()));
connect(containment, SIGNAL(launchActivated()), q, SIGNAL(launchActivated()));
connect(containment, SIGNAL(screenChanged(int,int,Plasma::Containment*)),
q, SIGNAL(screenOwnerChanged(int,int,Plasma::Containment*)));

View File

@ -146,6 +146,14 @@ Q_SIGNALS:
*/
void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment);
/**
* This signal indicates that an application launch, window
* creation or window focus event was triggered. This is used, for instance,
* to ensure that the Dashboard view in Plasma hides when such an event is
* triggered by an item it is displaying.
*/
void launchActivated();
protected:
/**
* Loads the default (system wide) layout for this user