mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Now using proper menu entries location on OS X
+ proper qt stuff localization
This commit is contained in:
parent
9e798e626c
commit
8d5f72de64
14
src/app.cpp
14
src/app.cpp
@ -3,6 +3,7 @@
|
||||
#include <QLocale>
|
||||
#include <QFileOpenEvent>
|
||||
#include <QNetworkProxyFactory>
|
||||
#include <QLibraryInfo>
|
||||
#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
|
||||
|
@ -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()));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user