1 #include <QApplication>
2 #include <QDebug>
3 #include <QFile>
4 #include <QStringList>
5 
6 #include "MainUI.h"
7 #include <LuminaOS.h>
8 #include <LuminaThemes.h>
9 #include <LUtils.h>
10 #include <LuminaSingleApplication.h>
11 
12 #include "ScreenSettings.h"
main(int argc,char ** argv)13 int main(int argc, char ** argv)
14 {
15     bool CLIdone = false;
16     for(int i=1; i<argc; i++){ //skip the first arg (app binary)
17       if(QString(argv[i]) == "--reset-monitors"){
18         RRSettings::ApplyPrevious();
19         CLIdone = true;
20         break;
21       }else if(QString(argv[i]) == "--mirror-monitors"){
22         RRSettings::MirrorAll();
23         CLIdone = true;
24         break;
25       }else if(QString(argv[i]) == "--list-profiles"){
26         qDebug() << RRSettings::savedProfiles().join("\n");
27         CLIdone = true;
28         break;
29       }else if(QString(argv[i]) == "--apply-profile" && argc > (i+1) ){
30         RRSettings::ApplyProfile( QString(argv[i+1]) );
31         CLIdone = true;
32         break;
33       }
34     }
35     if(CLIdone){ return 0; }
36    LTHEME::LoadCustomEnvSettings();
37     LSingleApplication a(argc, argv, "lumina-xconfig"); //loads translations inside constructor
38       if( !a.isPrimaryProcess()){ return 0; }
39     //qDebug() << "Loaded QApplication";
40     a.setApplicationName("Lumina Screen Configuration");
41     //LuminaThemeEngine themes(&a);
42 
43     //Start the UI
44     MainUI w;
45     QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &w, SLOT(slotSingleInstance()) );
46     //QObject::connect(&themes, SIGNAL(updateIcons()), &w, SLOT(loadIcons()) );
47     w.show();
48 
49     int retCode = a.exec();
50     return retCode;
51 }
52