-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
69 lines (65 loc) · 2.48 KB
/
Copy pathmain.cpp
File metadata and controls
69 lines (65 loc) · 2.48 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/****************************************************************************
**
** Copyright (C) 2019 Gianni Peschiutta
** Contact: https://bitbucket.org/Artemia/easymorse/src/master/
**
** FFS2Play is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**
** FFS2Play is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** The license is as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL3
** included in the packaging of this software. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
****************************************************************************/
/****************************************************************************
* main.cpp is part of EasyMorse project
*
* This is the entry point of easymorse application
* **************************************************************************/
#include "gui/mainwindow.h"
#include <QApplication>
#include <QSettings>
#include <QTranslator>
#include <QDir>
int main(int argc, char *argv[])
{
QSettings::setDefaultFormat(QSettings::NativeFormat);
QCoreApplication::setOrganizationName("EasyMorse");
QCoreApplication::setOrganizationDomain("");
QCoreApplication::setApplicationName("EasyMorse");
QString locale = QLocale::system().name();
QApplication a(argc, argv);
QDir::setCurrent(a.applicationDirPath());
QTranslator EasyMorseTS;
#ifdef Q_OS_LINUX
EasyMorseTS.load("/usr/share/easymorse/translations/easymorse_" + locale +".qm");
QFile styleFile ("/usr/share/easymorse/easymorse.qss");
#else
#ifdef Q_OS_MACOS
EasyMorseTS.load("../Resources/easymorse_"+ locale +".qm");
QFile styleFile ("../Resources/easymorse.qss");
#else
EasyMorseTS.load("translations/easymorse_" + locale +".qm");
QFile styleFile ( "easymorse.qss");
#endif
#endif
a.installTranslator(&EasyMorseTS);
//Load Style Sheet
styleFile.open(QFile::ReadOnly);
if (styleFile.isOpen())
{
a.setStyleSheet(styleFile.readAll());
styleFile.close();
}
MainWindow w;
w.show();
return a.exec();
}