Commit b2e56666 authored by Eike Ziller's avatar Eike Ziller

Mac: Sanitize shortcuts.

Task-number: QTCREATORBUG-7446
Change-Id: Ibad8f06e5f65bc01dc9fca6e9d900e24c5fc55a1
Reviewed-by: default avatarKarsten Heimrich <karsten.heimrich@nokia.com>
parent e129fcdc
......@@ -246,7 +246,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this);
cmd = Core::ActionManager::registerAction(m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+T")));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T")));
connect(m_openTypeHierarchyAction, SIGNAL(triggered()), this, SLOT(openTypeHierarchy()));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
......
......@@ -232,7 +232,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
tr("Add Bookmark"), this);
cmd = Core::ActionManager::registerAction(action, Core::Id("Help.AddBookmark"),
modecontext);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::Key_M));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+M") : tr("Ctrl+M")));
connect(action, SIGNAL(triggered()), this, SLOT(addBookmark()));
// Add Contents, Index, and Context menu items and a separator to the Help menu
......@@ -449,7 +449,7 @@ void HelpPlugin::setupUi()
shortcut->setWhatsThis(tr("Activate Index in Help mode"));
Core::Command* cmd = Core::ActionManager::registerShortcut(shortcut,
Core::Id("Help.IndexShortcut"), modecontext);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+I") : tr("Ctrl+Shift+I")));
connect(shortcut, SIGNAL(activated()), this, SLOT(activateIndex()));
shortcutMap.insert(QLatin1String(SB_INDEX), cmd);
......@@ -463,7 +463,7 @@ void HelpPlugin::setupUi()
shortcut->setWhatsThis(tr("Activate Contents in Help mode"));
cmd = Core::ActionManager::registerShortcut(shortcut, Core::Id("Help.ContentsShortcut"),
modecontext);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+C") : tr("Ctrl+Shift+C")));
connect(shortcut, SIGNAL(activated()), this, SLOT(activateContents()));
shortcutMap.insert(QLatin1String(SB_CONTENTS), cmd);
......@@ -477,7 +477,7 @@ void HelpPlugin::setupUi()
shortcut->setWhatsThis(tr("Activate Search in Help mode"));
cmd = Core::ActionManager::registerShortcut(shortcut, Core::Id("Help.SearchShortcut"),
modecontext);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Slash));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+/") : tr("Ctrl+Shift+/")));
connect(shortcut, SIGNAL(activated()), this, SLOT(activateSearch()));
shortcutMap.insert(QLatin1String(SB_SEARCH), cmd);
......@@ -494,7 +494,7 @@ void HelpPlugin::setupUi()
shortcut->setWhatsThis(tr("Activate Bookmarks in Help mode"));
cmd = Core::ActionManager::registerShortcut(shortcut, Core::Id("Help.BookmarkShortcut"),
modecontext);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+B") : tr("Ctrl+Shift+B")));
connect(shortcut, SIGNAL(activated()), this, SLOT(activateBookmarks()));
shortcutMap.insert(QLatin1String(SB_BOOKMARKS), cmd);
......@@ -506,7 +506,7 @@ void HelpPlugin::setupUi()
shortcut->setWhatsThis(tr("Activate Open Pages in Help mode"));
cmd = Core::ActionManager::registerShortcut(shortcut, Core::Id("Help.PagesShortcut"),
modecontext);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_O));
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+O") : tr("Ctrl+Shift+O")));
connect(shortcut, SIGNAL(activated()), this, SLOT(activateOpenPages()));
shortcutMap.insert(QLatin1String(SB_OPENPAGES), cmd);
......
......@@ -95,7 +95,7 @@ void ImageViewerActionHandler::createActions()
registerNewAction(ZoomOut, Constants::ACTION_ZOOM_OUT, tr("Zoom Out"),
QKeySequence(tr("Ctrl+-")));
registerNewAction(OriginalSize, Constants::ACTION_ORIGINAL_SIZE, tr("Original Size"),
QKeySequence(tr("Ctrl+0")));
QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
registerNewAction(FitToScreen, Constants::ACTION_FIT_TO_SCREEN, tr("Fit To Screen"),
QKeySequence(tr("Ctrl+=")));
registerNewAction(Background, Constants::ACTION_BACKGROUND, tr("Switch Background"),
......
......@@ -274,7 +274,7 @@ void TextEditorActionHandler::createActions()
m_resetFontSizeAction = new QAction(tr("Reset Font Size"), this);
command = Core::ActionManager::registerAction(m_resetFontSizeAction, Constants::RESET_FONT_SIZE, m_contextId);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? QString() : tr("Ctrl+0")));
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
connect(m_resetFontSizeAction, SIGNAL(triggered()), this, SLOT(resetFontSize()));
advancedMenu->addAction(command, Core::Constants::G_EDIT_FONT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment