Added basic cli interface to compton-conf
[lxde/compton-conf.git] / compton-conf.cpp
CommitLineData
012d3267
HJYP
1#include "compton-conf.h"
2#include <QApplication>
aaecf43e
HJYP
3#include <QLocale>
4#include <QLibraryInfo>
5#include <QTranslator>
e99d19d1 6#include <QCommandLineParser>
012d3267 7#include "maindialog.h"
012d3267
HJYP
8
9int main(int argc, char** argv) {
10 QApplication app(argc, argv);
aaecf43e 11
e99d19d1
AG
12 QCommandLineParser parser;
13 parser.setApplicationDescription(QStringLiteral("Compton Conf"));
14 const QString VERINFO = QStringLiteral(COMPTONCONF_VERSION
15 "\nQt " QT_VERSION_STR);
16 app.setApplicationVersion(VERINFO);
17 parser.addVersionOption();
18 parser.addHelpOption();
19 parser.process(app);
20
aaecf43e
HJYP
21 // load translations
22 QTranslator qtTranslator, translator;
23 // install the translations built-into Qt itself
24 qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
25 app.installTranslator(&qtTranslator);
26 // install our own tranlations
27 translator.load("compton-conf_" + QLocale::system().name(), COMPTON_CONF_DATA_DIR "/translations");
28 app.installTranslator(&translator);
29
c3b7cf80 30 MainDialog dlg;
012d3267
HJYP
31 dlg.exec();
32 return 0;
33}