From 8d5f72de64e9d448ebf3e18bb3729c6c326217be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 31 May 2017 23:37:02 +0200 Subject: [PATCH] Now using proper menu entries location on OS X + proper qt stuff localization --- src/app.cpp | 14 ++++++++++---- src/gui.cpp | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 534e8a4d..c43dcfbe 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "opengl.h" #include "gui.h" #include "onlinemap.h" @@ -13,11 +14,16 @@ App::App(int &argc, char **argv) : QApplication(argc, argv), _argc(argc), _argv(argv) { - QTranslator *translator = new QTranslator(this); - + QTranslator *gpxsee = new QTranslator(this); QString locale = QLocale::system().name(); - translator->load(QString(":/lang/gpxsee_") + locale); - installTranslator(translator); + gpxsee->load(QString(":/lang/gpxsee_") + locale); + installTranslator(gpxsee); + + QTranslator *qt = new QTranslator(this); + qt->load(QLocale::system(), "qt", "_", + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + installTranslator(qt); + #ifdef Q_OS_MAC setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Q_OS_MAC diff --git a/src/gui.cpp b/src/gui.cpp index 3e2ec2f7..1ac451c2 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -295,6 +295,7 @@ void GUI::createActions() // General actions _exitAction = new QAction(QIcon(QPixmap(QUIT_ICON)), tr("Quit"), this); _exitAction->setShortcut(QUIT_SHORTCUT); + _exitAction->setMenuRole(QAction::QuitRole); connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); addAction(_exitAction); @@ -305,6 +306,7 @@ void GUI::createActions() connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys())); _aboutAction = new QAction(QIcon(QPixmap(APP_ICON)), tr("About GPXSee"), this); + _aboutAction->setMenuRole(QAction::AboutRole); connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about())); // File actions @@ -477,6 +479,7 @@ void GUI::createActions() SLOT(showFullscreen(bool))); addAction(_fullscreenAction); _openOptionsAction = new QAction(tr("Options..."), this); + _openOptionsAction->setMenuRole(QAction::PreferencesRole); connect(_openOptionsAction, SIGNAL(triggered()), this, SLOT(openOptions()));