FakeVim: Change default keyboard sequence for FakeVim...

...on OSX to make it possible to enter and leave with the same
shortcut. Adjust user command mapping as well to be able to
execute these from inside FakeVim mode as well.

Task-number: QTCREATORBUG-14082
Change-Id: Ib93f798a61b4ed16db7cca7b3c927e1fb6bd5d0f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-03-03 15:13:05 +01:00
parent b9ab6b3f49
commit 1896d2cc0e

View File

@@ -1197,7 +1197,7 @@ bool FakeVimPluginPrivate::initialize()
Command *cmd = 0;
cmd = ActionManager::registerAction(theFakeVimSetting(ConfigUseFakeVim),
INSTALL_HANDLER, globalcontext, true);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? Tr::tr("Meta+V,Meta+V") : Tr::tr("Alt+V,Alt+V")));
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? Tr::tr("Meta+Shift+V,Meta+Shift+V") : Tr::tr("Alt+V,Alt+V")));
ActionContainer *advancedMenu =
ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED);
@@ -1208,7 +1208,7 @@ bool FakeVimPluginPrivate::initialize()
auto act = new QAction(this);
act->setText(Tr::tr("Execute User Action #%1").arg(i));
cmd = ActionManager::registerAction(act, base.withSuffix(i));
cmd->setDefaultKeySequence(QKeySequence((UseMacShortcuts ? Tr::tr("Meta+V,%1") : Tr::tr("Alt+V,%1")).arg(i)));
cmd->setDefaultKeySequence(QKeySequence((UseMacShortcuts ? Tr::tr("Meta+Shift+V,%1") : Tr::tr("Alt+V,%1")).arg(i)));
connect(act, &QAction::triggered, this, [this, i] { userActionTriggered(i); });
}