Add signals that incicate an application launch. DashBoardView can

connect and hide itself then, for example.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=737051
This commit is contained in:
Andre Duffeck 2007-11-15 11:06:33 +00:00
parent 7a333aee4c
commit 174096635e
5 changed files with 28 additions and 4 deletions

View File

@ -201,6 +201,8 @@ void AppletHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if (event->button()==Qt::LeftButton && m_pressedButton==releasedAtButton) {
if (m_pressedButton==ConfigureButton) {
//FIXME: Remove this call once the configuration management change was done
m_containment->emitLaunchActivated();
m_applet->showConfigurationInterface();
} else if (m_pressedButton==RemoveButton) {
Phase::self()->animateItem(m_applet, Phase::Disappear);

View File

@ -289,7 +289,7 @@ Applet* Containment::addApplet(const QString& name, const QVariantList& args, ui
//the applet needs to be given constraints before it can set its geometry
applet->updateConstraints(Plasma::AllConstraints);
//kDebug() << "adding applet" << applet->name() << "with a default geometry of" << appletGeometry << appletGeometry.isValid();
//kDebug() << "adding applet" << applet->name() << "with a default geometry of" << appletGeometry << appletGeometry.isValid();
if (appletGeometry.isValid()) {
applet->setGeometry(appletGeometry);
} else if (appletGeometry.x() != -1 && appletGeometry.y() != -1) {
@ -543,6 +543,12 @@ void Containment::handleDisappeared(AppletHandle *handle)
handle->deleteLater();
}
void Containment::emitLaunchActivated()
{
kDebug();
emit launchActivated();
}
}
#include "containment.moc"

View File

@ -195,12 +195,22 @@ class PLASMA_EXPORT Containment : public Applet
*/
void initConstraints(KConfigGroup* group);
/**
* Emits the launchActivated() signal
*/
void emitLaunchActivated();
Q_SIGNALS:
/**
* This signal is emitted when a new applet is created by the containment
*/
void appletAdded(Plasma::Applet* applet);
/**
* This signal indicates, that a application launch was triggered
*/
void launchActivated();
public Q_SLOTS:
/**
* Informs the Corona as to what position it is in. This is informational

View File

@ -305,9 +305,7 @@ Containment* Corona::addContainment(const QString& name, const QVariantList& arg
if (pluginName.isEmpty()) {
// default to the desktop containment
pluginName = "desktop";
}
if (pluginName != "null") {
} else if (pluginName != "null") {
applet = Applet::loadApplet(pluginName, id, args);
containment = dynamic_cast<Containment*>(applet);
}
@ -334,6 +332,8 @@ Containment* Corona::addContainment(const QString& name, const QVariantList& arg
d->containments.append(containment);
connect(containment, SIGNAL(destroyed(QObject*)),
this, SLOT(containmentDestroyed(QObject*)));
connect(containment, SIGNAL(launchActivated()),
SIGNAL(launchActivated()));
return containment;
}

View File

@ -154,6 +154,12 @@ public Q_SLOTS:
*/
void setImmutable(bool immutable_);
Q_SIGNALS:
/**
* This signal indicates, that a application launch was triggered
*/
void launchActivated();
protected:
void dragEnterEvent(QGraphicsSceneDragDropEvent* event);
void dragLeaveEvent(QGraphicsSceneDragDropEvent* event);