diff options
-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 (renamed from make-global-h.sh) | 0 | ||||
-rw-r--r-- | lumina-config/main.cpp | 6 | ||||
-rw-r--r-- | lumina-config/mainUI.cpp | 9 | ||||
-rw-r--r-- | lumina-config/mainUI.h | 4 | ||||
-rw-r--r-- | lumina-desktop/AppMenu.cpp | 6 | ||||
-rw-r--r-- | lumina-desktop/AppMenu.h | 2 | ||||
-rw-r--r-- | lumina-desktop/Globals.h | 4 | ||||
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 6 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 20 | ||||
-rw-r--r-- | lumina-desktop/SystemWindow.cpp | 4 | ||||
-rw-r--r-- | lumina-desktop/main.cpp | 19 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserWidget.h | 4 | ||||
-rw-r--r-- | lumina-fm/main.cpp | 6 | ||||
-rw-r--r-- | lumina-open/main.cpp | 31 | ||||
-rw-r--r-- | lumina-screenshot/main.cpp | 6 | ||||
-rw-r--r-- | lumina.pro | 6 |
19 files changed, 84 insertions, 96 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/make-global-h.sh b/libLumina/make-global-h.sh index f6457848..f6457848 100755 --- a/make-global-h.sh +++ b/libLumina/make-global-h.sh diff --git a/lumina-config/main.cpp b/lumina-config/main.cpp index 65f2bf08..415a3c85 100644 --- a/lumina-config/main.cpp +++ b/lumina-config/main.cpp @@ -8,7 +8,7 @@ #include <QFile> #include "mainUI.h" -#include "../global.h" +#include <LuminaOS.h> int main(int argc, char ** argv) { @@ -23,8 +23,8 @@ int main(int argc, char ** argv) QLocale mylocale; QString langCode = mylocale.name(); - if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-config_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); - translator.load( QString("lumina-config_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" ); + if ( ! QFile::exists(LOS::LuminaShare()+"i18n/lumina-config_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); + translator.load( QString("lumina-config_") + langCode, LOS::LuminaShare()+"i18n/" ); a.installTranslator( &translator ); qDebug() << "Locale:" << langCode; diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index cd3ae0a9..eb29ee8f 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -8,13 +8,12 @@ #include "ui_mainUI.h" //the designer *.ui file #include <LuminaOS.h> -#include "../global.h" MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){ ui->setupUi(this); //load the designer file this->setWindowIcon( LXDG::findIcon("preferences-desktop-display","") ); PINFO = new LPlugins(); //load the info class - + DEFAULTBG = LOS::LuminaShare()+"desktop-background.jpg"; //Be careful about the QSettings setup, it must match the lumina-desktop setup QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); settings = new QSettings( QSettings::UserScope, "LuminaDE", "desktopsettings", this); @@ -712,7 +711,7 @@ void MainUI::deskbgremoved(){ void MainUI::deskbgadded(){ //Prompt the user to find an image file to use for a background - QString dir = PREFIX + "/share/wallpapers/Lumina-DE"; + QString dir = LOS::LuminaShare()+"wallpapers/Lumina-DE"; if( !QFile::exists(dir) ){ dir = QDir::homePath(); } QStringList bgs = QFileDialog::getOpenFileNames(this, tr("Find Background Image(s)"), dir, "Images (*.png *.xpm *.jpg)"); if(bgs.isEmpty()){ return; } @@ -993,7 +992,7 @@ void MainUI::downmenuplugin(){ } void MainUI::findmenuterminal(){ - QString chkpath = PREFIX + "/bin"; + QString chkpath = LOS::AppPrefix() + "bin"; if(!QFile::exists(chkpath)){ chkpath = QDir::homePath(); } QString bin = QFileDialog::getOpenFileName(this, tr("Set Default Terminal Application"), chkpath, tr("Application Binaries (*)") ); if( bin.isEmpty() || !QFile::exists(bin) ){ return; } //cancelled @@ -1407,7 +1406,7 @@ void MainUI::addsessionstartapp(){ } void MainUI::addsessionstartbin(){ - QString chkpath = PREFIX + "/bin"; + QString chkpath = LOS::AppPrefix() + "bin"; if(!QFile::exists(chkpath)){ chkpath = QDir::homePath(); } QString bin = QFileDialog::getOpenFileName(this, tr("Select Binary"), chkpath, tr("Application Binaries (*)") ); if( bin.isEmpty() || !QFile::exists(bin) ){ return; } //cancelled diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h index 28e38984..565a3c61 100644 --- a/lumina-config/mainUI.h +++ b/lumina-config/mainUI.h @@ -26,9 +26,6 @@ #include "LPlugins.h" #include "KeyCatch.h" #include "AppDialog.h" -#include "../global.h" - -#define DEFAULTBG QString(PREFIX + "/share/Lumina-DE/desktop-background.jpg") //namespace for using the *.ui file namespace Ui{ @@ -48,6 +45,7 @@ private: LPlugins *PINFO; QMenu *ppmenu, *mpmenu; QString panelcolor; + QString DEFAULTBG; QList<XDGDesktop> sysApps; bool loading; bool moddesk, modpan, modmenu, modshort, moddef, modses; //page modified flags diff --git a/lumina-desktop/AppMenu.cpp b/lumina-desktop/AppMenu.cpp index 8893c629..496d0932 100644 --- a/lumina-desktop/AppMenu.cpp +++ b/lumina-desktop/AppMenu.cpp @@ -6,11 +6,11 @@ //=========================================== #include "AppMenu.h" #include "LSession.h" -#include "../global.h" +#include <LuminaOS.h> AppMenu::AppMenu(QWidget* parent) : QMenu(parent){ - appstorelink = PREFIX + "/share/applications/softmanager.desktop"; //Default application "store" to display (AppCafe in PC-BSD) - controlpanellink = PREFIX + "/share/applications/pccontrol.desktop"; //Default control panel + appstorelink = LOS::AppStoreShortcut(); //Default application "store" to display (AppCafe in PC-BSD) + controlpanellink = LOS::ControlPanelShortcut(); //Default control panel APPS.clear(); watcher = new QFileSystemWatcher(this); connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherUpdate()) ); diff --git a/lumina-desktop/AppMenu.h b/lumina-desktop/AppMenu.h index 66457f69..1657d9e2 100644 --- a/lumina-desktop/AppMenu.h +++ b/lumina-desktop/AppMenu.h @@ -35,7 +35,7 @@ public: private: QFileSystemWatcher *watcher; - QString appstorelink, controlpanellink; //default *.desktop file to use as the "store" + QString appstorelink, controlpanellink; QList<QMenu> MLIST; QHash<QString, QList<XDGDesktop> > APPS; diff --git a/lumina-desktop/Globals.h b/lumina-desktop/Globals.h index b2cac1eb..479fe4ad 100644 --- a/lumina-desktop/Globals.h +++ b/lumina-desktop/Globals.h @@ -8,7 +8,7 @@ #define _LUMINA_DESKTOP_GLOBALS_H #include <LuminaUtils.h> -#include "../global.h" +//#include "../global.h" #include <unistd.h> #include <stdio.h> @@ -27,7 +27,7 @@ public: class SYSTEM{ public: //Installation location for finding default files - static QString installDir(){ return PREFIX + "/share/Lumina-DE/"; } + //static QString installDir(){ return PREFIX + "/share/Lumina-DE/"; } //Current Username static QString user(){ return QString::fromLocal8Bit(getlogin()); } //Current Hostname diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index e555fac2..22606cf4 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -6,7 +6,9 @@ //=========================================== #include "LDesktop.h" #include "LSession.h" -#include "../global.h" + +#include <LuminaOS.h> +//#include "../global.h" LDesktop::LDesktop(int deskNum) : QObject(){ @@ -401,7 +403,7 @@ void LDesktop::UpdateBackground(){ //Save this file as the current background CBG = bgFile; //qDebug() << " - Set Background to:" << CBG << index << bgL; - if( (bgFile.toLower()=="default")){ bgFile = PREFIX + "/share/Lumina-DE/desktop-background.jpg"; } + if( (bgFile.toLower()=="default")){ bgFile = LOS::LuminaShare()+"desktop-background.jpg"; } //Now set this file as the current background QString style = "QWidget#bgWindow{ border-image:url(%1) stretch;}"; style = style.arg(bgFile); diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index f58b83fe..95272954 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -5,7 +5,7 @@ // See the LICENSE file for full details //=========================================== #include "LSession.h" -#include "../global.h" +#include <LuminaOS.h> #include <Phonon/MediaObject> #include <Phonon/AudioOutput> @@ -110,8 +110,8 @@ void LSession::setupSession(){ bool LSession::LoadLocale(QString langCode){ QTranslator translator; - if ( ! QFile::exists(SYSTEM::installDir()+"i18n/lumina-desktop_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); - bool ok = translator.load( QString("lumina-desktop_") + langCode, SYSTEM::installDir()+"i18n/" ); + if ( ! QFile::exists(LOS::LuminaShare()+"i18n/lumina-desktop_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); + bool ok = translator.load( QString("lumina-desktop_") + langCode, LOS::LuminaShare()+"i18n/" ); if(ok){ //Remove any old translator if(currTranslator != 0){ this->removeTranslator(currTranslator); } @@ -131,7 +131,7 @@ void LSession::launchStartupApps(){ qDebug() << "Launching startup applications"; for(int i=0; i<2; i++){ QString startfile; - if(i==0){startfile = PREFIX + "/share/Lumina-DE/startapps"; } + if(i==0){startfile = LOS::LuminaShare()+"startapps"; } else{ startfile = QDir::homePath()+"/.lumina/startapps"; } if(!QFile::exists(startfile)){ continue; } //go to the next @@ -150,7 +150,7 @@ void LSession::launchStartupApps(){ } //Now play the login music if(sessionsettings->value("PlayStartupAudio",true).toBool()){ - LSession::playAudioFile(PREFIX + "/share/Lumina-DE/Login.ogg"); + LSession::playAudioFile(LOS::LuminaShare()+"Login.ogg"); } if(sessionsettings->value("EnableNumlock",true).toBool()){ QProcess::startDetached("numlockx on"); @@ -175,8 +175,8 @@ void LSession::checkUserFiles(){ if(!QFile::exists(dset) || oldversion < 50){ if( oldversion < 50 ){ QFile::remove(dset); qDebug() << "Current desktop settings obsolete: Re-implementing defaults"; } else{ firstrun = true; } - if(QFile::exists(SYSTEM::installDir()+"desktopsettings.conf")){ - if( QFile::copy(SYSTEM::installDir()+"desktopsettings.conf", dset) ){ + if(QFile::exists(LOS::LuminaShare()+"desktopsettings.conf")){ + if( QFile::copy(LOS::LuminaShare()+"desktopsettings.conf", dset) ){ QFile::setPermissions(dset, QFile::ReadUser | QFile::WriteUser | QFile::ReadOwner | QFile::WriteOwner); } } @@ -185,8 +185,8 @@ void LSession::checkUserFiles(){ dset = QDir::homePath()+"/.lumina/LuminaDE/lumina-open.conf"; if(!QFile::exists(dset)){ firstrun = true; - if(QFile::exists(SYSTEM::installDir()+"defaultapps.conf")){ - if( QFile::copy(SYSTEM::installDir()+"defaultapps.conf", dset) ){ + if(QFile::exists(LOS::LuminaShare()+"defaultapps.conf")){ + if( QFile::copy(LOS::LuminaShare()+"defaultapps.conf", dset) ){ QFile::setPermissions(dset, QFile::ReadUser | QFile::WriteUser | QFile::ReadOwner | QFile::WriteOwner); } } @@ -219,7 +219,7 @@ void LSession::checkUserFiles(){ void LSession::loadStyleSheet(){ QString ss = QDir::homePath()+"/.lumina/stylesheet.qss"; - if(!QFile::exists(ss)){ ss = SYSTEM::installDir()+"stylesheet.qss"; } + if(!QFile::exists(ss)){ ss = LOS::LuminaShare()+"stylesheet.qss"; } if(!QFile::exists(ss)){ return; } //no default stylesheet on the system //Now read/apply the custom stylesheet QFile file(ss); diff --git a/lumina-desktop/SystemWindow.cpp b/lumina-desktop/SystemWindow.cpp index 55f1e4a4..3e723a36 100644 --- a/lumina-desktop/SystemWindow.cpp +++ b/lumina-desktop/SystemWindow.cpp @@ -2,7 +2,7 @@ #include "ui_SystemWindow.h" #include "LSession.h" -#include "../global.h" +#include <LuminaOS.h> #include <unistd.h> //for usleep() usage SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){ @@ -38,7 +38,7 @@ SystemWindow::~SystemWindow(){ void SystemWindow::closeAllWindows(){ if( LSession::sessionSettings()->value("PlayLogoutAudio",true).toBool() ){ - LSession::playAudioFile(PREFIX + "/share/Lumina-DE/Logout.ogg"); + LSession::playAudioFile(LOS::LuminaShare()+"Logout.ogg"); } QList<WId> WL = LX11::WindowList(); for(int i=0; i<WL.length(); i++){ diff --git a/lumina-desktop/main.cpp b/lumina-desktop/main.cpp index 3339e9ed..690ae80d 100644 --- a/lumina-desktop/main.cpp +++ b/lumina-desktop/main.cpp @@ -16,11 +16,8 @@ #include <QUrl> -//#include "WMProcess.h" -//#include "LDesktop.h" #include "LSession.h" #include "Globals.h" -#include "../global.h" #include <LuminaXDG.h> //from libLuminaUtils @@ -68,29 +65,13 @@ int main(int argc, char ** argv) //Setup Log File qInstallMsgHandler(MessageOutput); a.setupSession(); - //Start up the Window Manager - //qDebug() << " - Start Window Manager"; - //WMProcess WM; - //WM.startWM(); - //QObject::connect(&WM, SIGNAL(WMShutdown()), &a, SLOT(exit()) ); - //Load the initial translations - //QTranslator translator; a.LoadLocale(QLocale().name()); - //Now start the desktop - /*QDesktopWidget DW; - QList<LDesktop*> screens; - for(int i=0; i<DW.screenCount(); i++){ - qDebug() << " - Start Desktop " << i; - screens << new LDesktop(i); - a.processEvents(); - }*/ //Start launching external applications QTimer::singleShot(1000, &a, SLOT(launchStartupApps()) ); //wait a second first //QTimer::singleShot(1000, &a, SLOT(playStartupAudio()) ); int retCode = a.exec(); //a.playLogoutAudio(); //qDebug() << "Stopping the window manager"; - //WM.stopWM(); qDebug() << "Finished Closing Down Lumina"; logfile.close(); return retCode; diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h index 1b1405b3..06ad22e8 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.h +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h @@ -23,11 +23,7 @@ #include <LuminaXDG.h> #include <LuminaOS.h> #include "UserItemWidget.h" -#include "../../../global.h" -//#define APPSTORE QString(PREFIX + "/share/applications/softmanager.desktop") -//#define CONTROLPANEL QString(PREFIX + "/share/applications/pccontrol.desktop") -//#define QTCONFIG QString(PREFIX + "/bin/qtconfig-qt4") #define SSAVER QString("xscreensaver-demo") namespace Ui{ diff --git a/lumina-fm/main.cpp b/lumina-fm/main.cpp index 267e6e68..bc48d0db 100644 --- a/lumina-fm/main.cpp +++ b/lumina-fm/main.cpp @@ -8,7 +8,7 @@ #include <QTextCodec> #include "MainUI.h" -#include "../global.h" +#include <LuminaOS.h> int main(int argc, char ** argv) { @@ -31,8 +31,8 @@ int main(int argc, char ** argv) QLocale mylocale; QString langCode = mylocale.name(); - if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-fm_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); - translator.load( QString("lumina-fm_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" ); + if ( ! QFile::exists(LOS::LuminaShare()+"i18n/lumina-fm_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); + translator.load( QString("lumina-fm_") + langCode, LOS::LuminaShare()+"i18n/" ); a.installTranslator( &translator ); qDebug() << "Locale:" << langCode; diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index 427dbe04..c34a2c6a 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -25,7 +25,6 @@ #include <QTextCodec> #include "LFileDialog.h" -#include "../global.h" #include <LuminaXDG.h> #include <LuminaOS.h> @@ -42,24 +41,6 @@ void printUsageInfo(){ exit(1); } -/*QApplication setupApplication(int argc, char **argv){ - QApplication App(argc, argv); - QTranslator translator; - QLocale mylocale; - QString langCode = mylocale.name(); - - if(!QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-open_" + langCode + ".qm") ){ - langCode.truncate( langCode.indexOf("_") ); - } - translator.load( QString("lumina-open_") + langCode, PREFIX + "/share/Lumina-DE/i18n/" ); - App.installTranslator( &translator ); - qDebug() << "Locale:" << langCode; - //Load current encoding for this locale - QTextCodec::setCodecForTr( QTextCodec::codecForLocale() ); //make sure to use the same codec - qDebug() << "Locale Encoding:" << QTextCodec::codecForLocale()->name(); - return App; -}*/ - void showOSD(int argc, char **argv, QString message){ //Setup the application QApplication App(argc, argv); @@ -67,10 +48,10 @@ void showOSD(int argc, char **argv, QString message){ QLocale mylocale; QString langCode = mylocale.name(); - if(!QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-open_" + langCode + ".qm") ){ + if(!QFile::exists(LOS::LuminaShare()+"i18n/lumina-open_" + langCode + ".qm") ){ langCode.truncate( langCode.indexOf("_") ); } - translator.load( QString("lumina-open_") + langCode, PREFIX + "/share/Lumina-DE/i18n/" ); + translator.load( QString("lumina-open_") + langCode, LOS::LuminaShare()+"i18n/" ); App.installTranslator( &translator ); //Display the OSD @@ -118,10 +99,10 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS QLocale mylocale; QString langCode = mylocale.name(); - if(!QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-open_" + langCode + ".qm") ){ + if(!QFile::exists(LOS::LuminaShare()+"i18n/lumina-open_" + langCode + ".qm") ){ langCode.truncate( langCode.indexOf("_") ); } - translator.load( QString("lumina-open_") + langCode, PREFIX + "/share/Lumina-DE/i18n/" ); + translator.load( QString("lumina-open_") + langCode, LOS::LuminaShare()+"i18n/" ); App.installTranslator( &translator ); qDebug() << "Locale:" << langCode; @@ -320,10 +301,10 @@ int main(int argc, char **argv){ QLocale mylocale; QString langCode = mylocale.name(); - if(!QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-open_" + langCode + ".qm") ){ + if(!QFile::exists(LOS::LuminaShare()+"i18n/lumina-open_" + langCode + ".qm") ){ langCode.truncate( langCode.indexOf("_") ); } - translator.load( QString("lumina-open_") + langCode, PREFIX + "/share/Lumina-DE/i18n/" ); + translator.load( QString("lumina-open_") + langCode, LOS::LuminaShare()+"i18n/" ); App.installTranslator( &translator ); QMessageBox::critical(0,QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd); } diff --git a/lumina-screenshot/main.cpp b/lumina-screenshot/main.cpp index 40d7242d..0b564f71 100644 --- a/lumina-screenshot/main.cpp +++ b/lumina-screenshot/main.cpp @@ -4,7 +4,7 @@ #include <QFile> #include "MainUI.h" -#include "../global.h" +#include <LuminaOS.h> int main(int argc, char ** argv) { @@ -14,8 +14,8 @@ int main(int argc, char ** argv) QLocale mylocale; QString langCode = mylocale.name(); - if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-screenshot_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); - translator.load( QString("lumina-screenshot_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" ); + if ( ! QFile::exists(LOS::LuminaShare()+"i18n/lumina-screenshot_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_")); + translator.load( QString("lumina-screenshot_") + langCode, LOS::LuminaShare()+"i18n/" ); a.installTranslator( &translator ); qDebug() << "Locale:" << langCode; @@ -1,9 +1,3 @@ -isEmpty(PREFIX) { - PREFIX = /usr/local -} - -system(make-global-h.sh $$PREFIX) - TEMPLATE = subdirs SUBDIRS+= libLumina \ |