Commit 8242763f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

operator+/- is disabled for QFlags in qt6

parent 5dc22a93
......@@ -559,7 +559,7 @@ void Application::startBackgroundMode(MainWindow *window)
QAction* action = collection->addAction(QStringLiteral("toggle-background-window"));
action->setObjectName(QStringLiteral("Konsole Background Mode"));
action->setText(i18nc("@item", "Toggle Background Window"));
KGlobalAccel::self()->setGlobalShortcut(action, QKeySequence(Konsole::ACCEL + Qt::SHIFT + Qt::Key_F12));
KGlobalAccel::self()->setGlobalShortcut(action, QKeySequence(Konsole::ACCEL | Qt::SHIFT | Qt::Key_F12));
connect(action, &QAction::triggered, this, &Application::toggleBackgroundInstance);
_backgroundInstance = window;
......
......@@ -47,8 +47,8 @@ BookmarkMenu::BookmarkMenu (KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu
// replace Ctrl+B shortcut for bookmarks only if user hasn't already
// changed the shortcut; however, if the user changed it to Ctrl+B
// this will still get changed to Ctrl+Shift+B
if (bookmarkAction->shortcut() == QKeySequence(Konsole::ACCEL + Qt::Key_B)) {
collection->setDefaultShortcut(bookmarkAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_B);
if (bookmarkAction->shortcut() == QKeySequence(Konsole::ACCEL | Qt::Key_B)) {
collection->setDefaultShortcut(bookmarkAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_B);
}
}
......
......@@ -308,7 +308,7 @@ void MainWindow::setupActions()
// File Menu
_newTabMenuAction = new KActionMenu(QIcon::fromTheme(QStringLiteral("tab-new")),
i18nc("@action:inmenu", "&New Tab"), collection);
collection->setDefaultShortcut(_newTabMenuAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_T);
collection->setDefaultShortcut(_newTabMenuAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_T);
collection->setShortcutsConfigurable(_newTabMenuAction, true);
_newTabMenuAction->setAutoRepeat(false);
connect(_newTabMenuAction, &KActionMenu::triggered, this, &MainWindow::newTab);
......@@ -325,14 +325,14 @@ void MainWindow::setupActions()
menuAction = collection->addAction(QStringLiteral("new-window"));
menuAction->setIcon(QIcon::fromTheme(QStringLiteral("window-new")));
menuAction->setText(i18nc("@action:inmenu", "New &Window"));
collection->setDefaultShortcut(menuAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_N);
collection->setDefaultShortcut(menuAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_N);
menuAction->setAutoRepeat(false);
connect(menuAction, &QAction::triggered, this, &Konsole::MainWindow::newWindow);
menuAction = collection->addAction(QStringLiteral("close-window"));
menuAction->setIcon(QIcon::fromTheme(QStringLiteral("window-close")));
menuAction->setText(i18nc("@action:inmenu", "Close Window"));
collection->setDefaultShortcut(menuAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_Q);
collection->setDefaultShortcut(menuAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_Q);
connect(menuAction, &QAction::triggered, this, &Konsole::MainWindow::close);
// Bookmark Menu
......@@ -344,7 +344,7 @@ void MainWindow::setupActions()
// Settings Menu
_toggleMenuBarAction = KStandardAction::showMenubar(menuBar(), &QMenuBar::setVisible, collection);
collection->setDefaultShortcut(_toggleMenuBarAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_M);
collection->setDefaultShortcut(_toggleMenuBarAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_M);
// Full Screen
menuAction = KStandardAction::fullScreen(this, &MainWindow::viewFullScreen, this, collection);
......@@ -362,7 +362,7 @@ void MainWindow::setupActions()
// Set up an shortcut-only action for activating menu bar.
menuAction = collection->addAction(QStringLiteral("activate-menu"));
menuAction->setText(i18nc("@item", "Activate Menu"));
collection->setDefaultShortcut(menuAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_F10);
collection->setDefaultShortcut(menuAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_F10);
connect(menuAction, &QAction::triggered, this, &Konsole::MainWindow::activateMenuBar);
}
......
......@@ -104,26 +104,26 @@ void ViewManager::setupActions()
action->setText(i18nc("@action:inmenu", "Split View Left/Right"));
connect(action, &QAction::triggered, this, &ViewManager::splitLeftRight);
collection->addAction(QStringLiteral("split-view-left-right"), action);
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::Key_ParenLeft);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::Key_ParenLeft);
action = new QAction(this);
action->setIcon(QIcon::fromTheme(QStringLiteral("view-split-top-bottom")));
action->setText(i18nc("@action:inmenu", "Split View Top/Bottom"));
connect(action, &QAction::triggered, this, &ViewManager::splitTopBottom);
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::Key_ParenRight);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::Key_ParenRight);
collection->addAction(QStringLiteral("split-view-top-bottom"), action);
action = new QAction(this);
action->setText(i18nc("@action:inmenu", "Expand View"));
action->setEnabled(false);
connect(action, &QAction::triggered, this, &ViewManager::expandActiveContainer);
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_BracketRight);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_BracketRight);
collection->addAction(QStringLiteral("expand-active-view"), action);
_multiSplitterOnlyActions << action;
action = new QAction(this);
action->setText(i18nc("@action:inmenu", "Shrink View"));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_BracketLeft);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_BracketLeft);
action->setEnabled(false);
collection->addAction(QStringLiteral("shrink-active-view"), action);
connect(action, &QAction::triggered, this, &ViewManager::shrinkActiveContainer);
......@@ -139,7 +139,7 @@ void ViewManager::setupActions()
// 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(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_H);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_H);
action = collection->addAction(QStringLiteral("detach-tab"));
action->setEnabled(true);
......@@ -150,7 +150,7 @@ void ViewManager::setupActions()
// keyboard shortcut only actions
action = new QAction(i18nc("@action Shortcut entry", "Next Tab"), this);
const QList<QKeySequence> nextViewActionKeys{Qt::SHIFT + Qt::Key_Right, Qt::CTRL + Qt::Key_PageDown};
const QList<QKeySequence> nextViewActionKeys{Qt::SHIFT | Qt::Key_Right, Qt::CTRL | Qt::Key_PageDown};
collection->setDefaultShortcuts(action, nextViewActionKeys);
collection->addAction(QStringLiteral("next-tab"), action);
connect(action, &QAction::triggered, this, &ViewManager::nextView);
......@@ -158,7 +158,7 @@ void ViewManager::setupActions()
// _viewSplitter->addAction(nextViewAction);
action = new QAction(i18nc("@action Shortcut entry", "Previous Tab"), this);
const QList<QKeySequence> previousViewActionKeys{Qt::SHIFT + Qt::Key_Left, Qt::CTRL + Qt::Key_PageUp};
const QList<QKeySequence> previousViewActionKeys{Qt::SHIFT | Qt::Key_Left, Qt::CTRL | Qt::Key_PageUp};
collection->setDefaultShortcuts(action, previousViewActionKeys);
collection->addAction(QStringLiteral("previous-tab"), action);
connect(action, &QAction::triggered, this, &ViewManager::previousView);
......@@ -168,25 +168,25 @@ void ViewManager::setupActions()
action = new QAction(i18nc("@action Shortcut entry", "Focus Above Terminal"), this);
connect(action, &QAction::triggered, this, &ViewManager::focusUp);
collection->addAction(QStringLiteral("focus-view-above"), action);
collection->setDefaultShortcut(action, Qt::SHIFT + Qt::CTRL + Qt::Key_Up);
collection->setDefaultShortcut(action, Qt::SHIFT | Qt::CTRL | Qt::Key_Up);
_viewContainer->addAction(action);
_multiSplitterOnlyActions << action;
action = new QAction(i18nc("@action Shortcut entry", "Focus Below Terminal"), this);
collection->setDefaultShortcut(action, Qt::SHIFT + Qt::CTRL + Qt::Key_Down);
collection->setDefaultShortcut(action, Qt::SHIFT | Qt::CTRL | Qt::Key_Down);
collection->addAction(QStringLiteral("focus-view-below"), action);
connect(action, &QAction::triggered, this, &ViewManager::focusDown);
_multiSplitterOnlyActions << action;
_viewContainer->addAction(action);
action = new QAction(i18nc("@action Shortcut entry", "Focus Left Terminal"), this);
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Konsole::LEFT);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT + Konsole::LEFT);
connect(action, &QAction::triggered, this, &ViewManager::focusLeft);
collection->addAction(QStringLiteral("focus-view-left"), action);
_multiSplitterOnlyActions << action;
action = new QAction(i18nc("@action Shortcut entry", "Focus Right Terminal"), this);
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Konsole::RIGHT);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT + Konsole::RIGHT);
connect(action, &QAction::triggered, this, &ViewManager::focusRight);
collection->addAction(QStringLiteral("focus-view-right"), action);
_multiSplitterOnlyActions << action;
......@@ -198,7 +198,7 @@ void ViewManager::setupActions()
action = new QAction(i18nc("@action Shortcut entry", "Last Used Tabs"), this);
connect(action, &QAction::triggered, this, &ViewManager::lastUsedView);
collection->setDefaultShortcut(action, Qt::CTRL + Qt::Key_Tab);
collection->setDefaultShortcut(action, Qt::CTRL | Qt::Key_Tab);
collection->addAction(QStringLiteral("last-used-tab"), action);
action = new QAction(i18nc("@action Shortcut entry", "Toggle Between Two Tabs"), this);
......@@ -208,28 +208,28 @@ void ViewManager::setupActions()
action = new QAction(i18nc("@action Shortcut entry", "Last Used Tabs (Reverse)"), this);
collection->addAction(QStringLiteral("last-used-tab-reverse"), action);
collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_Tab);
collection->setDefaultShortcut(action, Qt::CTRL | Qt::SHIFT | Qt::Key_Tab);
connect(action, &QAction::triggered, this, &ViewManager::lastUsedViewReverse);
action = new QAction(i18nc("@action Shortcut entry", "Toggle maximize current view"), this);
action->setText(i18nc("@action:inmenu", "Toggle maximize current view"));
action->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
collection->addAction(QStringLiteral("toggle-maximize-current-view"), action);
collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_E);
collection->setDefaultShortcut(action, Qt::CTRL | Qt::SHIFT | Qt::Key_E);
connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::toggleMaximizeCurrentTerminal);
_multiSplitterOnlyActions << action;
_viewContainer->addAction(action);
action = new QAction(i18nc("@action Shortcut entry", "Move tab to the right"), this);
collection->addAction(QStringLiteral("move-tab-to-right"), action);
collection->setDefaultShortcut(action, Qt::CTRL + Qt::ALT + Qt::Key_Right);
collection->setDefaultShortcut(action, Qt::CTRL | Qt::ALT | Qt::Key_Right);
connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::moveTabRight);
_multiTabOnlyActions << action;
_viewContainer->addAction(action);
action = new QAction(i18nc("@action Shortcut entry", "Move tab to the left"), this);
collection->addAction(QStringLiteral("move-tab-to-left"), action);
collection->setDefaultShortcut(action, Qt::CTRL + Qt::ALT + Qt::Key_Left);
collection->setDefaultShortcut(action, Qt::CTRL | Qt::ALT | Qt::Key_Left);
connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::moveTabLeft);
_multiTabOnlyActions << action;
_viewContainer->addAction(action);
......@@ -247,7 +247,7 @@ void ViewManager::setupActions()
collection->setDefaultShortcut(action, QStringLiteral("Alt+%1").arg(i + 1));
} else if (i == 9) {
// add shortcut for 10th tab
collection->setDefaultShortcut(action, Qt::ALT + Qt::Key_0);
collection->setDefaultShortcut(action, Qt::ALT | Qt::Key_0);
}
}
......
......@@ -618,7 +618,7 @@ void SessionController::setupCommonActions()
action->setText(i18n("&Close Session"));
action->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_W);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_W);
// Open Browser
action = collection->addAction(QStringLiteral("open-browser"), this, &SessionController::openBrowser);
......@@ -630,9 +630,9 @@ void SessionController::setupCommonActions()
#ifdef Q_OS_MACOS
// Don't use the Konsole::ACCEL const here, we really want the Command key (Qt::META)
// TODO: check what happens if we leave it to Qt to assign the default?
collection->setDefaultShortcut(action, Qt::META + Qt::Key_C);
collection->setDefaultShortcut(action, Qt::META | Qt::Key_C);
#else
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_C);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_C);
#endif
// disabled at first, since nothing has been selected now
action->setEnabled(false);
......@@ -648,20 +648,20 @@ void SessionController::setupCommonActions()
action = KStandardAction::paste(this, &SessionController::paste, collection);
QList<QKeySequence> pasteShortcut;
#ifdef Q_OS_MACOS
pasteShortcut.append(QKeySequence(Qt::META + Qt::Key_V));
pasteShortcut.append(QKeySequence(Qt::META | Qt::Key_V));
// No Insert key on Mac keyboards
#else
pasteShortcut.append(QKeySequence(Konsole::ACCEL + Qt::SHIFT + Qt::Key_V));
pasteShortcut.append(QKeySequence(Qt::SHIFT + Qt::Key_Insert));
pasteShortcut.append(QKeySequence(Konsole::ACCEL | Qt::SHIFT | Qt::Key_V));
pasteShortcut.append(QKeySequence(Qt::SHIFT | Qt::Key_Insert));
#endif
collection->setDefaultShortcuts(action, pasteShortcut);
action = collection->addAction(QStringLiteral("paste-selection"), this, &SessionController::pasteFromX11Selection);
action->setText(i18n("Paste Selection"));
#ifdef Q_OS_MACOS
collection->setDefaultShortcut(action, Qt::META + Qt::SHIFT + Qt::Key_V);
collection->setDefaultShortcut(action, Qt::META | Qt::SHIFT | Qt::Key_V);
#else
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_Insert);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_Insert);
#endif
_webSearchMenu = new KActionMenu(i18n("Web Search"), this);
......@@ -680,12 +680,12 @@ void SessionController::setupCommonActions()
action = KStandardAction::saveAs(this, &SessionController::saveHistory, collection);
action->setText(i18n("Save Output &As..."));
#ifdef Q_OS_MACOS
action->setShortcut(QKeySequence(Qt::META + Qt::Key_S));
action->setShortcut(QKeySequence(Qt::META | Qt::Key_S));
#endif
action = KStandardAction::print(this, &SessionController::requestPrint, collection);
action->setText(i18n("&Print Screen..."));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_P);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_P);
action = collection->addAction(QStringLiteral("adjust-history"), this, &SessionController::showHistoryOptions);
action->setText(i18n("Adjust Scrollback..."));
......@@ -698,7 +698,7 @@ void SessionController::setupCommonActions()
action = collection->addAction(QStringLiteral("clear-history-and-reset"), this, &SessionController::clearHistoryAndReset);
action->setText(i18n("Clear Scrollback and Reset"));
action->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear-history")));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::SHIFT + Qt::Key_K);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::SHIFT | Qt::Key_K);
// Profile Options
action = collection->addAction(QStringLiteral("edit-current-profile"), this, &SessionController::editCurrentProfile);
......@@ -720,13 +720,13 @@ void SessionController::setupCommonActions()
_findPreviousAction->setEnabled(false);
#ifdef Q_OS_MACOS
collection->setDefaultShortcut(_findAction, Qt::META + Qt::Key_F);
collection->setDefaultShortcut(_findNextAction, Qt::META + Qt::Key_G);
collection->setDefaultShortcut(_findPreviousAction, Qt::META + Qt::SHIFT + Qt::Key_G);
collection->setDefaultShortcut(_findAction, Qt::META | Qt::Key_F);
collection->setDefaultShortcut(_findNextAction, Qt::META | Qt::Key_G);
collection->setDefaultShortcut(_findPreviousAction, Qt::META | Qt::SHIFT | Qt::Key_G);
#else
collection->setDefaultShortcut(_findAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_F);
collection->setDefaultShortcut(_findAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_F);
collection->setDefaultShortcut(_findNextAction, Qt::Key_F3);
collection->setDefaultShortcut(_findPreviousAction, Qt::SHIFT + Qt::Key_F3);
collection->setDefaultShortcut(_findPreviousAction, Qt::SHIFT | Qt::Key_F3);
#endif
// Character Encoding
......@@ -754,7 +754,7 @@ void SessionController::setupExtraActions()
QAction* action = collection->addAction(QStringLiteral("rename-session"), this, &SessionController::renameSession);
action->setText(i18n("&Configure or Rename Tab..."));
action->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::ALT + Qt::Key_S);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::ALT | Qt::Key_S);
// Copy input to ==> all tabs
auto* copyInputToAllTabsAction = collection->add<KToggleAction>(QStringLiteral("copy-input-to-all-tabs"));
......@@ -766,13 +766,13 @@ void SessionController::setupExtraActions()
// Copy input to ==> selected tabs
auto* copyInputToSelectedTabsAction = collection->add<KToggleAction>(QStringLiteral("copy-input-to-selected-tabs"));
copyInputToSelectedTabsAction->setText(i18n("&Select Tabs..."));
collection->setDefaultShortcut(copyInputToSelectedTabsAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_Period);
collection->setDefaultShortcut(copyInputToSelectedTabsAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_Period);
copyInputToSelectedTabsAction->setData(CopyInputToSelectedTabsMode);
// Copy input to ==> none
auto* copyInputToNoneAction = collection->add<KToggleAction>(QStringLiteral("copy-input-to-none"));
copyInputToNoneAction->setText(i18nc("@action:inmenu Do not select any tabs", "&None"));
collection->setDefaultShortcut(copyInputToNoneAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_Slash);
collection->setDefaultShortcut(copyInputToNoneAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_Slash);
copyInputToNoneAction->setData(CopyInputToNoneMode);
copyInputToNoneAction->setChecked(true); // the default state
......@@ -790,17 +790,17 @@ void SessionController::setupExtraActions()
action = collection->addAction(QStringLiteral("zmodem-upload"), this, &SessionController::zmodemUpload);
action->setText(i18n("&ZModem Upload..."));
action->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::ALT + Qt::Key_U);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::ALT | Qt::Key_U);
// Monitor
KToggleAction* toggleAction = new KToggleAction(i18n("Monitor for &Activity"), this);
collection->setDefaultShortcut(toggleAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_A);
collection->setDefaultShortcut(toggleAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_A);
action = collection->addAction(QStringLiteral("monitor-activity"), toggleAction);
connect(action, &QAction::toggled, this, &Konsole::SessionController::monitorActivity);
action->setIcon(QIcon::fromTheme(QStringLiteral("tools-media-optical-burn")));
toggleAction = new KToggleAction(i18n("Monitor for &Silence"), this);
collection->setDefaultShortcut(toggleAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_I);
collection->setDefaultShortcut(toggleAction, Konsole::ACCEL | Qt::SHIFT | Qt::Key_I);
action = collection->addAction(QStringLiteral("monitor-silence"), toggleAction);
connect(action, &QAction::toggled, this, &Konsole::SessionController::monitorSilence);
action->setIcon(QIcon::fromTheme(QStringLiteral("tools-media-optical-copy")));
......@@ -815,18 +815,18 @@ void SessionController::setupExtraActions()
action->setText(i18n("Enlarge Font"));
action->setIcon(QIcon::fromTheme(QStringLiteral("format-font-size-more")));
QList<QKeySequence> enlargeFontShortcut;
enlargeFontShortcut.append(QKeySequence(Konsole::ACCEL + Qt::Key_Plus));
enlargeFontShortcut.append(QKeySequence(Konsole::ACCEL + Qt::Key_Equal));
enlargeFontShortcut.append(QKeySequence(Konsole::ACCEL | Qt::Key_Plus));
enlargeFontShortcut.append(QKeySequence(Konsole::ACCEL | Qt::Key_Equal));
collection->setDefaultShortcuts(action, enlargeFontShortcut);
action = collection->addAction(QStringLiteral("shrink-font"), this, &SessionController::decreaseFontSize);
action->setText(i18n("Shrink Font"));
action->setIcon(QIcon::fromTheme(QStringLiteral("format-font-size-less")));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::Key_Minus);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::Key_Minus);
action = collection->addAction(QStringLiteral("reset-font-size"), this, &SessionController::resetFontSize);
action->setText(i18n("Reset Font Size"));
collection->setDefaultShortcut(action, Konsole::ACCEL + Qt::ALT + Qt::Key_0);
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::ALT | Qt::Key_0);
// Send signal
auto* sendSignalActions = collection->add<KSelectAction>(QStringLiteral("send-signal"));
......@@ -1805,9 +1805,9 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
// We don't actually use this shortcut, but we need to display it for consistency :/
QAction *copy = actionCollection()->action(QStringLiteral("edit_copy_contextmenu"));
#ifdef Q_OS_MACOS
copy->setShortcut(Qt::META + Qt::Key_C);
copy->setShortcut(Qt::META | Qt::Key_C);
#else
copy->setShortcut(Konsole::ACCEL + Qt::SHIFT + Qt::Key_C);
copy->setShortcut(Konsole::ACCEL | Qt::SHIFT | Qt::Key_C);
#endif
// prepend content-specific actions such as "Open Link", "Copy Email Address" etc
......
......@@ -47,7 +47,7 @@ void PartManualTest::testShortcutOverride()
auto mainWindow = new KMainWindow();
QMenu* fileMenu = mainWindow->menuBar()->addMenu(QStringLiteral("File"));
QAction* testAction = fileMenu->addAction(QStringLiteral("Test"));
testAction->setShortcut(QKeySequence(Konsole::ACCEL + Qt::Key_S));
testAction->setShortcut(QKeySequence(Konsole::ACCEL | Qt::Key_S));
connect(testAction, &QAction::triggered, this, &Konsole::PartManualTest::shortcutTriggered);
// Create terminal part and embed in into the main window
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment