aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-06-11 20:51:19 -0400
committerKen Moore <ken@pcbsd.org>2015-06-11 20:51:19 -0400
commitac15e22fe559bbfc267d99237674fba5a879806f (patch)
treefdb4cce3eeb5ecefcd3f61c9f3cdd40c99723ca3 /lumina-desktop/desktop-plugins
parentOops, forgot to save/commit the new fields in the luminaDesktop.conf gile. (diff)
downloadlumina-ac15e22fe559bbfc267d99237674fba5a879806f.tar.gz
lumina-ac15e22fe559bbfc267d99237674fba5a879806f.tar.bz2
lumina-ac15e22fe559bbfc267d99237674fba5a879806f.zip
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 <Lumina Share>/quickplugins/*.qml or ~/.lumina/quickplugins/*.qml
Diffstat (limited to 'lumina-desktop/desktop-plugins')
-rw-r--r--lumina-desktop/desktop-plugins/NewDP.h3
-rw-r--r--lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h42
2 files changed, 45 insertions, 0 deletions
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:"<<plugin << " -- Ignored";
}
diff --git a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
new file mode 100644
index 00000000..a59ed87f
--- /dev/null
+++ b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
@@ -0,0 +1,42 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2015, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This class is a simple container for a QtQuick plugin
+//===========================================
+#ifndef _LUMINA_DESKTOP_DESKTOP_PLUGIN_QUICK_H
+#define _LUMINA_DESKTOP_DESKTOP_PLUGIN_QUICK_H
+
+#include <QQuickWidget>
+#include <QVBoxLayout>
+#include "../LDPlugin.h"
+
+#include <LuminaUtils.h>
+
+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
bgstack15