From ac15e22fe559bbfc267d99237674fba5a879806f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 11 Jun 2015 20:51:19 -0400 Subject: Add two new plugins for Lumina: QuickPPlugin, QuickDPlugin (panel/desktop respectively). These are QtQuick "containers" which allow the loading of user/system supplied QML scripts for non-compiled plugin support. These plugins must be single *.qml files located in /quickplugins/*.qml or ~/.lumina/quickplugins/*.qml --- lumina-desktop/desktop-plugins/NewDP.h | 3 ++ .../desktop-plugins/quickcontainer/QuickDPlugin.h | 42 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h (limited to 'lumina-desktop/desktop-plugins') diff --git a/lumina-desktop/desktop-plugins/NewDP.h b/lumina-desktop/desktop-plugins/NewDP.h index 3e7c5eec..78f10981 100644 --- a/lumina-desktop/desktop-plugins/NewDP.h +++ b/lumina-desktop/desktop-plugins/NewDP.h @@ -20,6 +20,7 @@ #include "notepad/NotepadPlugin.h" #include "audioplayer/PlayerWidget.h" #include "systemmonitor/MonitorWidget.h" +#include "quickcontainer/QuickDPlugin.h" //#include "messagecenter/MessageCenter.h" class NewDP{ @@ -43,6 +44,8 @@ public: plug = new SysMonitorPlugin(parent, plugin); //}else if(plugin.section("---",0,0)=="messagecenter"){ //plug = new MessageCenterPlugin(parent, plugin); + }else if(plugin.section("---",0,0).startsWith("quick-") && LUtils::validQuickPlugin(plugin.section("---",0,0)) ){ + plug = new QuickDPlugin(parent, plugin); }else{ qWarning() << "Invalid Desktop Plugin:"< +#include +#include "../LDPlugin.h" + +#include + +class QuickDPlugin : public LDPlugin{ + Q_OBJECT +public: + QuickDPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){ + this->setLayout( new QVBoxLayout()); + this->layout()->setContentsMargins(0,0,0,0); + container = new QQuickWidget(this); + this->layout()->addWidget(container); + container->setSource(QUrl::fromLocalFile( LUtils::findQuickPluginFile(ID.section("---",0,0)) )); + } + + ~QuickDPlugin(){} + +private: + QQuickWidget *container; + +private slots: + void statusChange(QQuickWidget::Status status){ + if(status == QQuickWidget::Error){ + qDebug() << "Quick Widget Error:" << this->ID(); + } + } + +}; +#endif -- cgit