forked from lxqt/compton-conf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompton-conf.cpp
34 lines (30 loc) · 1.14 KB
/
compton-conf.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "compton-conf.h"
#include <QApplication>
#include <QLocale>
#include <QLibraryInfo>
#include <QTranslator>
#include <QCommandLineParser>
#include "maindialog.h"
int main(int argc, char** argv) {
QApplication app(argc, argv);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral("Compton Conf"));
const QString VERINFO = QStringLiteral(COMPTONCONF_VERSION
"\nQt " QT_VERSION_STR);
app.setApplicationVersion(VERINFO);
parser.addVersionOption();
parser.addHelpOption();
parser.process(app);
// load translations
QTranslator qtTranslator, translator;
// install the translations built-into Qt itself
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
// install our own tranlations
translator.load("compton-conf_" + QLocale::system().name(), COMPTON_CONF_DATA_DIR "/translations");
app.installTranslator(&translator);
MainDialog dlg;
dlg.exec();
return 0;
}