diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp index c70c2c013d9..1bbe0c6e922 100644 --- a/src/plugins/coreplugin/actionmanager/command.cpp +++ b/src/plugins/coreplugin/actionmanager/command.cpp @@ -313,6 +313,10 @@ void Action::addOverrideAction(QAction *action, const Core::Context &context, bo { if (Utils::HostOsInfo::isMacHost()) action->setIconVisibleInMenu(false); + // disallow TextHeuristic menu role, because it doesn't work with translations, + // e.g. QTCREATORBUG-13101 + if (action->menuRole() == QAction::TextHeuristicRole) + action->setMenuRole(QAction::NoRole); if (isEmpty()) m_action->initialize(action); if (context.isEmpty()) { diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index fd407e3c7b8..fe609f40fb5 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -562,9 +562,9 @@ void MainWindow::registerDefaultActions() // Exit Action icon = QIcon::fromTheme(QLatin1String("application-exit")); m_exitAction = new QAction(icon, tr("E&xit"), this); + m_exitAction->setMenuRole(QAction::QuitRole); cmd = ActionManager::registerAction(m_exitAction, Constants::EXIT, globalContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Q"))); - cmd->action()->setMenuRole(QAction::QuitRole); mfile->addAction(cmd, Constants::G_FILE_OTHER); connect(m_exitAction, SIGNAL(triggered()), this, SLOT(exit())); @@ -633,11 +633,9 @@ void MainWindow::registerDefaultActions() mtools->addSeparator(globalContext, Constants::G_TOOLS_OPTIONS); m_optionsAction = new QAction(tr("&Options..."), this); + m_optionsAction->setMenuRole(QAction::PreferencesRole); cmd = ActionManager::registerAction(m_optionsAction, Constants::OPTIONS, globalContext); - if (UseMacShortcuts) { - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+,"))); - cmd->action()->setMenuRole(QAction::PreferencesRole); - } + cmd->setDefaultKeySequence(QKeySequence::Preferences); mtools->addAction(cmd, Constants::G_TOOLS_OPTIONS); connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog())); @@ -660,7 +658,6 @@ void MainWindow::registerDefaultActions() // Full Screen Action QAction *toggleFullScreenAction = new QAction(tr("Full Screen"), this); - toggleFullScreenAction->setMenuRole(QAction::NoRole); toggleFullScreenAction->setCheckable(!Utils::HostOsInfo::isMacHost()); toggleFullScreenAction->setEnabled(false); // actual implementation in WindowSupport cmd = ActionManager::registerAction(toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, globalContext); @@ -716,18 +713,16 @@ void MainWindow::registerDefaultActions() tmpaction = new QAction(icon, tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu else tmpaction = new QAction(icon, tr("About &Qt Creator..."), this); + tmpaction->setMenuRole(QAction::AboutRole); cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR, globalContext); - if (Utils::HostOsInfo::isMacHost()) - cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutQtCreator())); //About Plugins Action tmpaction = new QAction(tr("About &Plugins..."), this); + tmpaction->setMenuRole(QAction::ApplicationSpecificRole); cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_PLUGINS, globalContext); - if (Utils::HostOsInfo::isMacHost()) - cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins())); diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index 2cd9d5caa27..ef90d949a7c 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -650,7 +650,6 @@ void FormEditorData::setupActions() mformtools->addSeparator(m_contexts, Core::Constants::G_DEFAULT_THREE); m_actionAboutPlugins = new QAction(tr("About Qt Designer Plugins..."), m_instance); - m_actionAboutPlugins->setMenuRole(QAction::NoRole); addToolAction(m_actionAboutPlugins, m_contexts, "FormEditor.AboutPlugins", mformtools, QString(), Core::Constants::G_DEFAULT_THREE); QObject::connect(m_actionAboutPlugins, &QAction::triggered,