full popupapplet support
svn path=/trunk/KDE/kdebase/runtime/; revision=1097178
This commit is contained in:
parent
b03d2dc7bd
commit
3b16876d4a
@ -389,4 +389,39 @@ void PopupAppletInterface::setPopupIconByName(const QString &name)
|
||||
return popupApplet()->setPopupIcon(name);
|
||||
}
|
||||
|
||||
void PopupAppletInterface::setPassivePopup(bool passive)
|
||||
{
|
||||
popupApplet()->setPassivePopup(passive);
|
||||
}
|
||||
|
||||
bool PopupAppletInterface::isPassivePopup() const
|
||||
{
|
||||
return popupApplet()->isPassivePopup();
|
||||
}
|
||||
|
||||
void PopupAppletInterface::togglePopup()
|
||||
{
|
||||
popupApplet()->togglePopup();
|
||||
}
|
||||
|
||||
void PopupAppletInterface::hidePopup()
|
||||
{
|
||||
popupApplet()->hidePopup();
|
||||
}
|
||||
|
||||
void PopupAppletInterface::showPopup()
|
||||
{
|
||||
popupApplet()->showPopup();
|
||||
}
|
||||
|
||||
void PopupAppletInterface::setPopupWidget(QGraphicsWidget *widget)
|
||||
{
|
||||
popupApplet()->setGraphicsWidget(widget);
|
||||
}
|
||||
|
||||
QGraphicsWidget *PopupAppletInterface::popupWidget()
|
||||
{
|
||||
return popupApplet()->graphicsWidget();
|
||||
}
|
||||
|
||||
#include "appletinterface.moc"
|
||||
|
@ -282,6 +282,8 @@ class PopupAppletInterface : public AppletInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QIcon popupIcon READ popupIcon WRITE setPopupIcon)
|
||||
Q_PROPERTY(bool passivePopup READ isPassivePopup WRITE setPassivePopup)
|
||||
Q_PROPERTY(QGraphicsWidget *popupWidget READ popupWidget WRITE setPopupWidget)
|
||||
|
||||
public:
|
||||
PopupAppletInterface(SimpleJavaScriptApplet *parent);
|
||||
@ -291,8 +293,17 @@ public:
|
||||
|
||||
inline Plasma::PopupApplet *popupApplet() const { return static_cast<Plasma::PopupApplet *>(m_appletScriptEngine->applet()); }
|
||||
|
||||
void setPassivePopup(bool passive);
|
||||
bool isPassivePopup() const;
|
||||
|
||||
void setPopupWidget(QGraphicsWidget *widget);
|
||||
QGraphicsWidget *popupWidget();
|
||||
|
||||
public Q_SLOTS:
|
||||
void setPopupIconByName(const QString &name);
|
||||
void togglePopup();
|
||||
void hidePopup();
|
||||
void showPopup();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -183,6 +183,13 @@ void SimpleJavaScriptApplet::extenderItemRestored(Plasma::ExtenderItem* item)
|
||||
callFunction("initExtenderItem", args);
|
||||
}
|
||||
|
||||
void SimpleJavaScriptApplet::popupEvent(bool popped)
|
||||
{
|
||||
QScriptValueList args;
|
||||
args << popped;
|
||||
callFunction("popupEvent", args);
|
||||
}
|
||||
|
||||
void SimpleJavaScriptApplet::executeAction(const QString &name)
|
||||
{
|
||||
//callFunction("action_" + name);
|
||||
@ -330,6 +337,10 @@ void SimpleJavaScriptApplet::setupObjects()
|
||||
m_self.setScope(global);
|
||||
global.setProperty("plasmoid", m_self);
|
||||
|
||||
if (isPopupApplet) {
|
||||
connect(applet(), SIGNAL(popupEvent(bool)), this, SLOT(popupEvent(bool)));
|
||||
}
|
||||
|
||||
QScriptValue args = m_engine->newArray();
|
||||
int i = 0;
|
||||
foreach (const QVariant &arg, applet()->startupArguments()) {
|
||||
|
@ -64,6 +64,7 @@ public Q_SLOTS:
|
||||
void executeAction(const QString &name);
|
||||
void collectGarbage();
|
||||
void extenderItemRestored(Plasma::ExtenderItem* item);
|
||||
void popupEvent(bool popped);
|
||||
|
||||
private Q_SLOTS:
|
||||
void engineReportsError(ScriptEnv *engine, bool fatal);
|
||||
|
Loading…
Reference in New Issue
Block a user