diff options
author | Ken Moore <ken@pcbsd.org> | 2015-06-11 20:51:19 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-06-11 20:51:19 -0400 |
commit | ac15e22fe559bbfc267d99237674fba5a879806f (patch) | |
tree | fdb4cce3eeb5ecefcd3f61c9f3cdd40c99723ca3 /libLumina | |
parent | Oops, forgot to save/commit the new fields in the luminaDesktop.conf gile. (diff) | |
download | lumina-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 'libLumina')
-rw-r--r-- | libLumina/LuminaUtils.cpp | 15 | ||||
-rw-r--r-- | libLumina/LuminaUtils.h | 6 | ||||
-rw-r--r-- | libLumina/libLumina.pro | 5 |
3 files changed, 24 insertions, 2 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 7d53af3e..b569782e 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -181,6 +181,21 @@ double LUtils::DisplaySizeToBytes(QString num){ return N; } +//Various function for finding valid QtQuick plugins on the system +bool LUtils::validQuickPlugin(QString ID){ + return ( !LUtils::findQuickPluginFile(ID).isEmpty() ); +} + +QString LUtils::findQuickPluginFile(QString ID){ + if(ID.startsWith("quick-")){ ID = ID.section("-",1,50); } + //Give preference to any user-supplied plugins (overwrites for system plugins) + QString path = QDir::homePath()+"/.lumina/quickplugins/"+ID+".qml"; + if( QFile::exists(path) ){return path; } + path = LOS::LuminaShare()+"quickplugins/"+ID+".qml"; + if( QFile::exists(path) ){return path; } + return ""; //could not be found +} + QStringList LUtils::listFavorites(){ static QStringList fav; static QDateTime lastRead; diff --git a/libLumina/LuminaUtils.h b/libLumina/LuminaUtils.h index 434970ef..605f2653 100644 --- a/libLumina/LuminaUtils.h +++ b/libLumina/LuminaUtils.h @@ -1,6 +1,6 @@ //=========================================== // Lumina-DE source code -// Copyright (c) 2012, Ken Moore +// Copyright (c) 2012-2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== @@ -53,6 +53,10 @@ public: static double DisplaySizeToBytes(QString num); //Turn a display size (like 50M or 50KB) into a double for calculations (bytes) + //Various function for finding valid QtQuick plugins on the system + static bool validQuickPlugin(QString ID); + static QString findQuickPluginFile(QString ID); + //Various functions for the favorites sub-system // Formatting Note: "<name>::::[dir/app/<mimetype>]::::<path>" // the <name> field might not be used for "app" flagged entries diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index 4aa25154..2cfd20db 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -81,6 +81,9 @@ themes.path=$$PREFIX/share/Lumina-DE/themes/ themes.files=themes/Lumina-default.qss.template \ themes/None.qss.template -INSTALLS += target include colors themes +quickplugins.path=$$PREFIX/share/Lumina-DE/quickplugins/ +quickplugins.files=quickplugins/*.qml + +INSTALLS += target include colors themes quickplugins QMAKE_LIBDIR = $$LIBPREFIX/qt5 $$LIBPREFIX |