Shortcut to enable/disable shortcuts routing to terminal

Fixes: QTCREATORBUG-29876
Change-Id: I8b04c09ce1de7dab968499773179f663c1c6fe7d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Xavier BESSON
2023-11-13 09:40:37 +01:00
committed by Xavier BESSON (Personal)
parent 218f346fcc
commit 223deb5968
4 changed files with 16 additions and 0 deletions

View File

@@ -125,6 +125,8 @@ TerminalPane::TerminalPane(QObject *parent)
updateLockButton();
connect(&toggleKeyboardLock, &QAction::triggered, m_lockKeyboardButton, &QToolButton::toggle);
connect(m_lockKeyboardButton, &QToolButton::toggled, this, [this, updateLockButton] {
settings().lockKeyboard.setValue(m_lockKeyboardButton->isChecked());
updateLockButton();
@@ -292,6 +294,8 @@ void TerminalPane::initActions()
closeTerminal.setIcon(CLOSE_TERMINAL_ICON.icon());
closeTerminal.setToolTip(Tr::tr("Close the current Terminal."));
toggleKeyboardLock.setText(Tr::tr("Toggle Keyboard Lock"));
using namespace Constants;
Command *cmd = ActionManager::registerAction(&newTerminal, NEWTERMINAL, m_selfContext);
@@ -310,6 +314,10 @@ void TerminalPane::initActions()
QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Shift+]")
: QLatin1String("Ctrl+PgDown"))});
ActionManager::registerAction(&toggleKeyboardLock,
TOGGLE_KEYBOARD_LOCK,
m_selfContext);
connect(&newTerminal, &QAction::triggered, this, [this] { openTerminal({}); });
connect(&closeTerminal, &QAction::triggered, this, [this] {
removeTab(m_tabWidget.currentIndex());