Add missing functions to AppletScript.

Review: http://reviewboard.kde.org/r/2074/

svn path=/trunk/KDE/kdelibs/; revision=1045306
This commit is contained in:
Petri Damstén 2009-11-05 18:43:39 +00:00
parent 2d0f7dc81b
commit 2b4edfd6cd
3 changed files with 60 additions and 0 deletions

View File

@ -391,6 +391,9 @@ void Applet::setFailedToLaunch(bool failed, const QString &reason)
void Applet::saveState(KConfigGroup &group) const
{
if (d->script) {
emit d->script->saveState(group);
}
if (group.config()->name() != config().config()->name()) {
// we're being saved to a different file!
// let's just copy the current values in our configuration over

View File

@ -148,6 +148,35 @@ void AppletScript::addStandardConfigurationPages(KConfigDialog *dialog)
}
void AppletScript::showMessage(const QIcon &icon, const QString &message, const MessageButtons buttons)
{
if (applet()) {
applet()->showMessage(icon, message, buttons);
}
}
void AppletScript::registerAsDragHandle(QGraphicsItem *item)
{
if (applet()) {
applet()->registerAsDragHandle(item);
}
}
void AppletScript::unregisterAsDragHandle(QGraphicsItem *item)
{
if (applet()) {
applet()->unregisterAsDragHandle(item);
}
}
bool AppletScript::isRegisteredAsDragHandle(QGraphicsItem *item)
{
if (applet()) {
return applet()->isRegisteredAsDragHandle(item);
}
return false;
}
void AppletScript::configChanged()
{
}

View File

@ -141,6 +141,12 @@ public:
*/
Extender *extender() const;
Q_SIGNALS:
/**
* @see Applet
*/
void saveState(KConfigGroup &group) const;
public Q_SLOTS:
/**
@ -188,7 +194,29 @@ protected:
*/
void addStandardConfigurationPages(KConfigDialog *dialog);
/**
* @see Applet
*/
void showMessage(const QIcon &icon, const QString &message, const MessageButtons buttons);
/**
* @see Applet
*/
void registerAsDragHandle(QGraphicsItem *item);
/**
* @see Applet
*/
void unregisterAsDragHandle(QGraphicsItem *item);
/**
* @see Applet
*/
bool isRegisteredAsDragHandle(QGraphicsItem *item);
private:
friend class Applet;
AppletScriptPrivate *const d;
};