-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
40 lines (34 loc) · 1.32 KB
/
main.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
35
36
37
38
39
40
/*
This Program was written by Eric Baudach <[email protected]>
and is licensed under the GPL version 3 or newer versions of GPL.
<Copyright (C) 2010-2012 Eric Baudach>
*/
#include <QtGui/QApplication>
#include <widget.h>
#include <QTranslator>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setEffectEnabled(Qt::UI_AnimateCombo, true);
a.setEffectEnabled(Qt::UI_AnimateMenu, true);
a.setEffectEnabled(Qt::UI_FadeTooltip, true);
a.setEffectEnabled(Qt::UI_FadeMenu, true);
#ifdef QT_DEBUG
const QString & Translation_path = a.applicationDirPath() + "/po";
qDebug() << "Load translations from: " + Translation_path;
#else
const QString & Translation_path = QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/cortina";
#endif
QTranslator qtTranslator;
if(!qtTranslator.load(QLocale::system().name(), Translation_path)) {
if(QLocale::system().name().startsWith("en_") == false) {
qDebug() << "Can't load translation file:";
qDebug() << QLocale::system().name() + ".qm in " + QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/cortina";
}
}
a.installTranslator(&qtTranslator);
a.setApplicationName("Cortina");
a.setApplicationVersion("1.1.1");
Widget w;
return a.exec();
}