diff options
Diffstat (limited to 'libLumina')
-rw-r--r-- | libLumina/LuminaOS.h | 10 | ||||
-rw-r--r-- | libLumina/LuminaThemes.cpp | 35 | ||||
-rw-r--r-- | libLumina/libLumina.pro | 2 | ||||
-rwxr-xr-x | libLumina/make-global-h.sh | 7 |
4 files changed, 49 insertions, 5 deletions
diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h index f4fe8970..90f68691 100644 --- a/libLumina/LuminaOS.h +++ b/libLumina/LuminaOS.h @@ -19,9 +19,19 @@ #include "LuminaUtils.h" +//First try to load the globals.h to set PREFIX +#ifndef PREFIX +#include "global.h" +#endif +//Now use the default value for PREFIX if not set +#ifndef PREFIX +#define PREFIX QString("/usr/local") +#endif + class LOS{ public: //OS-specific prefix(s) + static QString LuminaShare(){ return (PREFIX+"/share/Lumina-DE/"); } //Install dir for Lumina share files static QString AppPrefix(); //Prefix for applications (/usr/local/ on FreeBSD) static QString SysPrefix(); //Prefix for system (/usr/ on FreeBSD) diff --git a/libLumina/LuminaThemes.cpp b/libLumina/LuminaThemes.cpp index d1869ae4..0ec46c67 100644 --- a/libLumina/LuminaThemes.cpp +++ b/libLumina/LuminaThemes.cpp @@ -11,23 +11,48 @@ QStringList LTHEME::availableSystemThemes(){ //returns: [name::::path] for each item - + QDir dir(LOS::LuminaShare()+"themes"); + QStringList list = dir.entryList(QStringList() <<"*.qss.template", QDir::Files, QDir::Name()); + for(int i=0; i<list.length(); i++){ + //Format the output entry [<name>::::<fullpath>] + list[i] = list[i].section(".qss.",0,0)+"::::"+dir.absoluteFilePath(list[i]); + } + return list; } QStringList LTHEME::availableLocalThemes(){ //returns: [name::::path] for each item - + QDir dir(QDir::homePath()+"/.lumina/themes"); + QStringList list = dir.entryList(QStringList() <<"*.qss.template", QDir::Files, QDir::Name()); + for(int i=0; i<list.length(); i++){ + //Format the output entry [<name>::::<fullpath>] + list[i] = list[i].section(".qss.",0,0)+"::::"+dir.absoluteFilePath(list[i]); + } + return list; } QStringList LTHEME::availableSystemColors(){ //returns: [name::::path] for each item - + //returns: [name::::path] for each item + QDir dir(LOS::LuminaShare()+"colors"); + QStringList list = dir.entryList(QStringList() <<"*.qss.colortemplate", QDir::Files, QDir::Name()); + for(int i=0; i<list.length(); i++){ + //Format the output entry [<name>::::<fullpath>] + list[i] = list[i].section(".qss.",0,0)+"::::"+dir.absoluteFilePath(list[i]); + } + return list; } QStringList LTHEME::availableLocalColors(){ //returns: [name::::path] for each item - + QDir dir(QDir::homePath()+"/.lumina/colors"); + QStringList list = dir.entryList(QStringList() <<"*.qss.template", QDir::Files, QDir::Name()); + for(int i=0; i<list.length(); i++){ + //Format the output entry [<name>::::<fullpath>] + list[i] = list[i].section(".qss.",0,0)+"::::"+dir.absoluteFilePath(list[i]); + } + return list; } QStringList LTHEME::availableSystemIcons(){ //returns: [name] for each item - + return QStringList(); //not implemented yet } //Return the currently selected Theme/Colors/Icons diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index 72fa6f6c..3bc6b516 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -7,6 +7,8 @@ isEmpty(PREFIX) { PREFIX = /usr/local } +system(./make-global-h.sh $$PREFIX) + isEmpty(LIBPREFIX) { LIBPREFIX = $$PREFIX/lib } diff --git a/libLumina/make-global-h.sh b/libLumina/make-global-h.sh new file mode 100755 index 00000000..f6457848 --- /dev/null +++ b/libLumina/make-global-h.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# create global.h + +echo "#ifndef PREFIX + #define PREFIX QString(\"${1}\") +#endif" > global.h |