shortcut adaptation to platform standards on Mac

REVIEW: 120323
This commit is contained in:
R.J.V. Bertin
2016-11-24 17:35:31 +01:00
parent 2671800b08
commit 378518ea4b
12 changed files with 118 additions and 50 deletions

View File

@@ -143,19 +143,19 @@ void ViewManager::setupActions()
QAction* splitLeftRightAction = new QAction(QIcon::fromTheme(QStringLiteral("view-split-left-right")),
i18nc("@action:inmenu", "Split View Left/Right"),
this);
collection->setDefaultShortcut(splitLeftRightAction, Qt::CTRL + Qt::Key_ParenLeft);
collection->setDefaultShortcut(splitLeftRightAction, Konsole::ACCEL + Qt::Key_ParenLeft);
collection->addAction("split-view-left-right", splitLeftRightAction);
connect(splitLeftRightAction , &QAction::triggered , this , &Konsole::ViewManager::splitLeftRight);
QAction* splitTopBottomAction = new QAction(QIcon::fromTheme(QStringLiteral("view-split-top-bottom")) ,
i18nc("@action:inmenu", "Split View Top/Bottom"), this);
collection->setDefaultShortcut(splitTopBottomAction, Qt::CTRL + Qt::Key_ParenRight);
collection->setDefaultShortcut(splitTopBottomAction, Konsole::ACCEL + Qt::Key_ParenRight);
collection->addAction("split-view-top-bottom", splitTopBottomAction);
connect(splitTopBottomAction , &QAction::triggered , this , &Konsole::ViewManager::splitTopBottom);
QAction* closeActiveAction = new QAction(i18nc("@action:inmenu Close Active View", "Close Active") , this);
closeActiveAction->setIcon(QIcon::fromTheme(QStringLiteral("view-close")));
collection->setDefaultShortcut(closeActiveAction, Qt::CTRL + Qt::SHIFT + Qt::Key_X);
collection->setDefaultShortcut(closeActiveAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_X);
closeActiveAction->setEnabled(false);
collection->addAction("close-active-view", closeActiveAction);
connect(closeActiveAction , &QAction::triggered , this , &Konsole::ViewManager::closeActiveContainer);
@@ -163,7 +163,7 @@ void ViewManager::setupActions()
multiViewOnlyActions << closeActiveAction;
QAction* closeOtherAction = new QAction(i18nc("@action:inmenu Close Other Views", "Close Others") , this);
collection->setDefaultShortcut(closeOtherAction, Qt::CTRL + Qt::SHIFT + Qt::Key_O);
collection->setDefaultShortcut(closeOtherAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_O);
closeOtherAction->setEnabled(false);
collection->addAction("close-other-views", closeOtherAction);
connect(closeOtherAction , &QAction::triggered , this , &Konsole::ViewManager::closeOtherContainers);
@@ -172,7 +172,7 @@ void ViewManager::setupActions()
// Expand & Shrink Active View
QAction* expandActiveAction = new QAction(i18nc("@action:inmenu", "Expand View") , this);
collection->setDefaultShortcut(expandActiveAction, Qt::CTRL + Qt::SHIFT + Qt::Key_BracketRight);
collection->setDefaultShortcut(expandActiveAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_BracketRight);
expandActiveAction->setEnabled(false);
collection->addAction("expand-active-view", expandActiveAction);
connect(expandActiveAction , &QAction::triggered , this , &Konsole::ViewManager::expandActiveContainer);
@@ -180,7 +180,7 @@ void ViewManager::setupActions()
multiViewOnlyActions << expandActiveAction;
QAction* shrinkActiveAction = new QAction(i18nc("@action:inmenu", "Shrink View") , this);
collection->setDefaultShortcut(shrinkActiveAction, Qt::CTRL + Qt::SHIFT + Qt::Key_BracketLeft);
collection->setDefaultShortcut(shrinkActiveAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_BracketLeft);
shrinkActiveAction->setEnabled(false);
collection->addAction("shrink-active-view", shrinkActiveAction);
connect(shrinkActiveAction , &QAction::triggered , this , &Konsole::ViewManager::shrinkActiveContainer);
@@ -193,7 +193,7 @@ void ViewManager::setupActions()
detachViewAction->setText(i18nc("@action:inmenu", "D&etach Current Tab"));
// Ctrl+Shift+D is not used as a shortcut by default because it is too close
// to Ctrl+D - which will terminate the session in many cases
collection->setDefaultShortcut(detachViewAction, Qt::CTRL + Qt::SHIFT + Qt::Key_H);
collection->setDefaultShortcut(detachViewAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_H);
connect(this , &Konsole::ViewManager::splitViewToggle , this , &Konsole::ViewManager::updateDetachViewState);
connect(detachViewAction , &QAction::triggered , this , &Konsole::ViewManager::detachActiveView);
@@ -236,11 +236,19 @@ void ViewManager::setupActions()
connect(nextContainerAction , &QAction::triggered , this , &Konsole::ViewManager::nextContainer);
_viewSplitter->addAction(nextContainerAction);
collection->setDefaultShortcut(moveViewLeftAction, Qt::CTRL + Qt::SHIFT + Qt::Key_Left);
#ifdef Q_OS_OSX
collection->setDefaultShortcut(moveViewLeftAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_BracketLeft);
#else
collection->setDefaultShortcut(moveViewLeftAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_Left);
#endif
connect(moveViewLeftAction , &QAction::triggered , this , &Konsole::ViewManager::moveActiveViewLeft);
_viewSplitter->addAction(moveViewLeftAction);
collection->setDefaultShortcut(moveViewRightAction, Qt::CTRL + Qt::SHIFT + Qt::Key_Right);
#ifdef Q_OS_OSX
collection->setDefaultShortcut(moveViewRightAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_BracketRight);
#else
collection->setDefaultShortcut(moveViewRightAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_Right);
#endif
connect(moveViewRightAction , &QAction::triggered , this , &Konsole::ViewManager::moveActiveViewRight);
_viewSplitter->addAction(moveViewRightAction);