Add Traditional Chinese desktop entry
[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>
8a16c16d 6#ifndef USE_QT4
e99d19d1 7#include <QCommandLineParser>
8a16c16d 8#endif
012d3267 9#include "maindialog.h"
012d3267
HJYP
10
11int main(int argc, char** argv) {
12 QApplication app(argc, argv);
8a16c16d 13#ifndef USE_QT4
338997ea 14 app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
aaecf43e 15
e99d19d1
AG
16 QCommandLineParser parser;
17 parser.setApplicationDescription(QStringLiteral("Compton Conf"));
18 const QString VERINFO = QStringLiteral(COMPTONCONF_VERSION
19 "\nQt " QT_VERSION_STR);
20 app.setApplicationVersion(VERINFO);
21 parser.addVersionOption();
22 parser.addHelpOption();
23 parser.process(app);
8a16c16d 24#endif
e99d19d1 25
aaecf43e
HJYP
26 // load translations
27 QTranslator qtTranslator, translator;
28 // install the translations built-into Qt itself
29 qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
30 app.installTranslator(&qtTranslator);
31 // install our own tranlations
32 translator.load("compton-conf_" + QLocale::system().name(), COMPTON_CONF_DATA_DIR "/translations");
33 app.installTranslator(&translator);
34
c3b7cf80 35 MainDialog dlg;
012d3267
HJYP
36 dlg.exec();
37 return 0;
38}