src/platform/qt/main.cpp (view raw)
1/* Copyright (c) 2013-2014 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include "GBAApp.h"
7#include "Window.h"
8
9#include <QLibraryInfo>
10#include <QTranslator>
11
12#include <mgba/core/version.h>
13
14#ifdef QT_STATIC
15#include <QtPlugin>
16#ifdef _WIN32
17Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
18#ifdef BUILD_QT_MULTIMEDIA
19Q_IMPORT_PLUGIN(QWindowsAudioPlugin);
20#endif
21#endif
22#endif
23
24int main(int argc, char* argv[]) {
25 QGBA::GBAApp application(argc, argv);
26
27 QLocale locale = QLocale::system();
28
29 QTranslator qtTranslator;
30 qtTranslator.load(locale, "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
31 application.installTranslator(&qtTranslator);
32
33 QTranslator langTranslator;
34 langTranslator.load(locale, binaryName, "-", ":/translations/");
35 application.installTranslator(&langTranslator);
36
37 return application.exec();
38}