diff options
| author | Stephan Sahm <[email protected]> | 2022-01-25 17:33:01 +0000 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2022-01-25 17:33:01 +0000 |
| commit | d71b617205ce152dedc5d3a5b5b801697741f8eb (patch) | |
| tree | 624e6d84dce4c12d732172747160ed68913ddabf /src/dolphinmainwindow.cpp | |
| parent | 94262a1c02606279b03e40f2cb3ebc985ff69a08 (diff) | |
Expose konsolepart shortcuts in Dolphin's shortcuts view
Adapt some changes from Yakuake https://invent.kde.org/utilities/yakuake/-/commit/a0b08cb1f71ef18449bfbf5852c01e323604142f
credit to Stephan Sahm @schlichtanders
BUG: 428265
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index ef671e820..ff3cfa3bf 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -53,6 +53,7 @@ #include <KProtocolInfo> #include <KProtocolManager> #include <KShell> +#include <KShortcutsDialog> #include <KStandardAction> #include <KStartupInfo> #include <KSycoca> @@ -170,7 +171,7 @@ DolphinMainWindow::DolphinMainWindow() : setupDockWidgets(); - setupGUI(Keys | Save | Create | ToolBar); + setupGUI(Save | Create | ToolBar); stateChanged(QStringLiteral("new_file")); QClipboard* clipboard = QApplication::clipboard(); @@ -1372,6 +1373,19 @@ void DolphinMainWindow::slotStorageTearDownExternallyRequested(const QString& mo } } +void DolphinMainWindow::slotKeyBindings() +{ + KShortcutsDialog dialog(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, this); + dialog.addCollection(actionCollection()); + if (m_terminalPanel) { + KActionCollection *konsolePartActionCollection = m_terminalPanel->actionCollection(); + if (konsolePartActionCollection) { + dialog.addCollection(konsolePartActionCollection, QStringLiteral("KonsolePart")); + } + } + dialog.configure(); +} + void DolphinMainWindow::setViewsToHomeIfMountPathOpen(const QString& mountPath) { const QVector<DolphinViewContainer*> theViewContainers = viewContainers(); @@ -1709,6 +1723,7 @@ void DolphinMainWindow::setupActions() "contain mostly the same commands and configuration options.")); connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822 this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection); + KStandardAction::keyBindings(this, &DolphinMainWindow::slotKeyBindings, actionCollection()); KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection()); // setup 'Help' menu for the m_controlButton. The other one is set up in the base class. |
