Mac: Avoid more Opt+<char> shortcuts.

Change-Id: I1f2ae70ed8b184be6d1467642924289af1b535a9
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Eike Ziller
2012-05-23 14:02:36 +02:00
parent 6c3a96787c
commit 71260c3167
7 changed files with 13 additions and 9 deletions

View File

@@ -39,6 +39,7 @@
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <texteditor/basetexteditor.h> #include <texteditor/basetexteditor.h>
@@ -784,7 +785,7 @@ Id BookmarkViewFactory::id() const
QKeySequence BookmarkViewFactory::activationSequence() const QKeySequence BookmarkViewFactory::activationSequence() const
{ {
return QKeySequence(Qt::ALT + Qt::Key_M); return QKeySequence(Core::UseMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M"));
} }
Core::NavigationView BookmarkViewFactory::createWidget() Core::NavigationView BookmarkViewFactory::createWidget()

View File

@@ -41,6 +41,7 @@
#include <coreplugin/documentmanager.h> #include <coreplugin/documentmanager.h>
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QTimer> #include <QTimer>
@@ -240,7 +241,7 @@ Core::Id OpenEditorsViewFactory::id() const
QKeySequence OpenEditorsViewFactory::activationSequence() const QKeySequence OpenEditorsViewFactory::activationSequence() const
{ {
return QKeySequence(Qt::ALT + Qt::Key_O); return QKeySequence(Core::UseMacShortcuts ? tr("Meta+O") : tr("Alt+O"));
} }
OpenEditorsViewFactory::OpenEditorsViewFactory() OpenEditorsViewFactory::OpenEditorsViewFactory()

View File

@@ -970,7 +970,7 @@ bool FakeVimPluginPrivate::initialize()
Core::Command *cmd = 0; Core::Command *cmd = 0;
cmd = actionManager->registerAction(theFakeVimSetting(ConfigUseFakeVim), cmd = actionManager->registerAction(theFakeVimSetting(ConfigUseFakeVim),
Constants::INSTALL_HANDLER, globalcontext, true); Constants::INSTALL_HANDLER, globalcontext, true);
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+V,Alt+V"))); cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+V,Meta+V") : tr("Alt+V,Alt+V")));
ActionContainer *advancedMenu = ActionContainer *advancedMenu =
actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED); actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED);
@@ -982,7 +982,7 @@ bool FakeVimPluginPrivate::initialize()
act->setData(i); act->setData(i);
QString id = QString("FakeVim.UserAction%1").arg(i); QString id = QString("FakeVim.UserAction%1").arg(i);
cmd = actionManager->registerAction(act, Core::Id(id), globalcontext); cmd = actionManager->registerAction(act, Core::Id(id), globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+V,%1").arg(i))); cmd->setDefaultKeySequence(QKeySequence((Core::UseMacShortcuts ? tr("Meta+V,%1") : tr("Alt+V,%1")).arg(i)));
connect(act, SIGNAL(triggered()), SLOT(userActionTriggered())); connect(act, SIGNAL(triggered()), SLOT(userActionTriggered()));
} }

View File

@@ -101,7 +101,7 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *errorMessag
QAction *executeLastMacro = new QAction(tr("Play Last Macro"), this); QAction *executeLastMacro = new QAction(tr("Play Last Macro"), this);
command = am->registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext); command = am->registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+R"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+R") : tr("Alt+R")));
mmacrotools->addAction(command); mmacrotools->addAction(command);
connect(executeLastMacro, SIGNAL(triggered()), m_macroManager, SLOT(executeLastMacro())); connect(executeLastMacro, SIGNAL(triggered()), m_macroManager, SLOT(executeLastMacro()));

View File

@@ -36,6 +36,7 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
#include <coreplugin/documentmanager.h> #include <coreplugin/documentmanager.h>
@@ -408,7 +409,7 @@ Core::Id FolderNavigationWidgetFactory::id() const
QKeySequence FolderNavigationWidgetFactory::activationSequence() const QKeySequence FolderNavigationWidgetFactory::activationSequence() const
{ {
return QKeySequence(Qt::ALT + Qt::Key_Y); return QKeySequence(Core::UseMacShortcuts ? tr("Meta+Y") : tr("Alt+Y"));
} }
Core::NavigationView FolderNavigationWidgetFactory::createWidget() Core::NavigationView FolderNavigationWidgetFactory::createWidget()

View File

@@ -39,6 +39,7 @@
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
#include "projectmodels.h" #include "projectmodels.h"
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
@@ -412,7 +413,7 @@ Core::Id ProjectTreeWidgetFactory::id() const
QKeySequence ProjectTreeWidgetFactory::activationSequence() const QKeySequence ProjectTreeWidgetFactory::activationSequence() const
{ {
return QKeySequence(Qt::ALT + Qt::Key_X); return QKeySequence(Core::UseMacShortcuts ? tr("Meta+X") : tr("Alt+X"));
} }
Core::NavigationView ProjectTreeWidgetFactory::createWidget() Core::NavigationView ProjectTreeWidgetFactory::createWidget()

View File

@@ -358,13 +358,13 @@ void TextEditorActionHandler::createActions()
m_upperCaseSelectionAction = new QAction(tr("Uppercase Selection"), this); m_upperCaseSelectionAction = new QAction(tr("Uppercase Selection"), this);
m_modifyingActions << m_upperCaseSelectionAction; m_modifyingActions << m_upperCaseSelectionAction;
command = am->registerAction(m_upperCaseSelectionAction, Constants::UPPERCASE_SELECTION, m_contextId, true); command = am->registerAction(m_upperCaseSelectionAction, Constants::UPPERCASE_SELECTION, m_contextId, true);
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+U"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+U") : tr("Alt+Shift+U")));
connect(m_upperCaseSelectionAction, SIGNAL(triggered()), this, SLOT(uppercaseSelection())); connect(m_upperCaseSelectionAction, SIGNAL(triggered()), this, SLOT(uppercaseSelection()));
m_lowerCaseSelectionAction = new QAction(tr("Lowercase Selection"), this); m_lowerCaseSelectionAction = new QAction(tr("Lowercase Selection"), this);
m_modifyingActions << m_lowerCaseSelectionAction; m_modifyingActions << m_lowerCaseSelectionAction;
command = am->registerAction(m_lowerCaseSelectionAction, Constants::LOWERCASE_SELECTION, m_contextId, true); command = am->registerAction(m_lowerCaseSelectionAction, Constants::LOWERCASE_SELECTION, m_contextId, true);
command->setDefaultKeySequence(QKeySequence(tr("Alt+U"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+U") : tr("Alt+U")));
connect(m_lowerCaseSelectionAction, SIGNAL(triggered()), this, SLOT(lowercaseSelection())); connect(m_lowerCaseSelectionAction, SIGNAL(triggered()), this, SLOT(lowercaseSelection()));
m_circularPasteAction = new QAction(tr("Paste from Clipboard History"), this); m_circularPasteAction = new QAction(tr("Paste from Clipboard History"), this);