From 5e2bc6f39873688f8af62589a7ea482d478d3fbb Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 12 Dec 2023 18:40:21 +0100 Subject: [PATCH] Terminal: Restrict shortcuts Amends a0c05cabcc3df0. Specifically Ctrl+Shift+T conflicts with opening the type hiearchy pane when in a C++-editor. Change-Id: Id4da738162ad9c90d6b45c4142a207ea22511d18 Reviewed-by: Reviewed-by: Marcus Tillmanns --- src/plugins/terminal/terminalpane.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 3e4ce3e8b79..f1561a17c72 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -232,6 +232,7 @@ void TerminalPane::initActions() newTerminalAction.setText(Tr::tr("New Terminal")); newTerminalAction.setIcon(NEW_TERMINAL_ICON.icon()); newTerminalAction.setToolTip(Tr::tr("Create a new Terminal.")); + newTerminalAction.setContext(m_selfContext); newTerminalAction.setDefaultKeySequences({QKeySequence( HostOsInfo::isMacHost() ? QLatin1String("Ctrl+T") : QLatin1String("Ctrl+Shift+T"))}); newTerminalAction.setOnTriggered(this, [this] { openTerminal({}); }); @@ -241,11 +242,13 @@ void TerminalPane::initActions() closeTerminalAction.setText(Tr::tr("Close Terminal")); closeTerminalAction.setIcon(CLOSE_TERMINAL_ICON.icon()); closeTerminalAction.setToolTip(Tr::tr("Close the current Terminal.")); + closeTerminalAction.setContext(m_selfContext); closeTerminalAction.setOnTriggered(this, [this] { removeTab(m_tabWidget.currentIndex()); }); m_closeTerminalAction = closeTerminalAction.commandAction(); ActionBuilder nextTerminalAction(this, NEXTTERMINAL); nextTerminalAction.setText(Tr::tr("Next Terminal")); + nextTerminalAction.setContext(m_selfContext); nextTerminalAction.setDefaultKeySequences( {QKeySequence("Alt+Tab"), QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Shift+[") @@ -257,6 +260,7 @@ void TerminalPane::initActions() ActionBuilder prevTerminalAction(this, PREVTERMINAL); prevTerminalAction.setText(Tr::tr("Previous Terminal")); + prevTerminalAction.setContext(m_selfContext); prevTerminalAction.setDefaultKeySequences( {QKeySequence("Alt+Shift+Tab"), QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Shift+]")