* add a Phase object to the corona; start using it.

TODO:
* use all the Phase transitions properly; this implies reworking the remove applet mechanism completely
* consider sharing Phase amongst all Coronas? should it be a singleton?

svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=673395
This commit is contained in:
Aaron J. Seigo 2007-06-10 06:24:42 +00:00
parent eb330b2a79
commit 3b8fc737e4

View File

@ -35,11 +35,10 @@
#include "applet.h"
#include "dataengine.h"
#include "karambamanager.h"
#include "phase.h"
#include "widgets/vboxlayout.h"
#include "widgets/icon.h"
#include "karambamanager.h"
#include "corona.h"
using namespace Plasma;
@ -53,12 +52,14 @@ public:
: formFactor(Planar),
location(Floating),
layout(0),
engineExplorerAction(0)
engineExplorerAction(0),
phase(new Phase)
{
}
~Private()
{
delete phase;
delete layout;
qDeleteAll(applets);
}
@ -69,6 +70,7 @@ public:
Location location;
Layout* layout;
QAction *engineExplorerAction;
Phase* phase;
};
Corona::Corona(QObject * parent)
@ -193,6 +195,7 @@ void Corona::addPlasmoid(const QString& name)
d->applets << applet;
connect(applet, SIGNAL(destroyed(QObject*)),
this, SLOT(appletDestroyed(QObject*)));
d->phase->animate(applet, Phase::Appear);
} else {
kDebug() << "Plasmoid " << name << " could not be loaded." << endl;
}
@ -203,6 +206,7 @@ void Corona::addKaramba(const KUrl& path)
QGraphicsItemGroup* karamba = KarambaManager::loadKaramba(path, this);
if (karamba) {
addItem(karamba);
d->phase->animate(karamba, Phase::Appear);
} else {
kDebug() << "Karamba " << path << " could not be loaded." << endl;
}