1 /***********************************************************************
2  *
3  * Copyright (C) 2007, 2008, 2012, 2013, 2014, 2015, 2018, 2019 Graeme Gott <graeme@gottcode.org>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  ***********************************************************************/
19 
20 #include "locale_dialog.h"
21 #include "window.h"
22 
23 #include <QApplication>
24 
main(int argc,char ** argv)25 int main(int argc, char** argv)
26 {
27 #if !defined(Q_OS_MAC)
28 	if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO")
29 			&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
30 			&& !qEnvironmentVariableIsSet("QT_SCALE_FACTOR")
31 			&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
32 		QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
33 	}
34 #endif
35 	QApplication app(argc, argv);
36 	app.setApplicationName("Gottet");
37 	app.setApplicationVersion(VERSIONSTR);
38 	app.setApplicationDisplayName(Window::tr("Gottet"));
39 	app.setOrganizationDomain("gottcode.org");
40 	app.setOrganizationName("GottCode");
41 #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
42 	app.setWindowIcon(QIcon::fromTheme("gottet", QIcon(":/gottet.png")));
43 	app.setDesktopFileName("gottet");
44 #endif
45 	app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
46 
47 	LocaleDialog::loadTranslator("gottet_");
48 
49 	Window window;
50 	window.show();
51 
52 	return app.exec();
53 }
54