diff options
| author | arnav dhamija <[email protected]> | 2017-02-13 22:24:01 +0530 |
|---|---|---|
| committer | arnav dhamija <[email protected]> | 2017-02-13 22:24:01 +0530 |
| commit | ccb3658b3aa7f5b0f0b71cb6e91808bdfe58af64 (patch) | |
| tree | cf6b1cd277d7a410278802aa600be0c65af6bd64 /src/dolphinmainwindow.cpp | |
| parent | 41253c0c81bafb54a0b6c82e5282e3add85e8a50 (diff) | |
| parent | 0d4924d8bbab256b13ae13040201bea7ea04ab2f (diff) | |
Merge branch 'stashAction'
This adds the support for the Stash action which will be helpful for the upcoming stash:/ ioslave
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 5bca8d06f..a2e9c0dd8 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -57,6 +57,7 @@ #include <KIO/JobUiDelegate> #include <KLocalizedString> #include <KProtocolManager> +#include <KProtocolInfo> #include <QMenu> #include <KMessageBox> #include <KFileItemListProperties> @@ -523,6 +524,13 @@ void DolphinMainWindow::toggleSplitView() updateViewActions(); } +void DolphinMainWindow::toggleSplitStash() +{ + DolphinTabPage* tabPage = m_tabWidget->currentTabPage(); + tabPage->setSplitViewEnabled(false); + tabPage->setSplitViewEnabled(true, QUrl("stash:/")); +} + void DolphinMainWindow::reloadView() { clearStatusBar(); @@ -1041,6 +1049,15 @@ void DolphinMainWindow::setupActions() actionCollection()->setDefaultShortcut(split, Qt::Key_F3); connect(split, &QAction::triggered, this, &DolphinMainWindow::toggleSplitView); + QAction* stashSplit = actionCollection()->addAction(QStringLiteral("split_stash")); + actionCollection()->setDefaultShortcut(stashSplit, Qt::CTRL | Qt::Key_S); + stashSplit->setText(i18nc("@action:intoolbar Stash", "Stash")); + stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window")); + stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-visiting"))); + stashSplit->setCheckable(false); + stashSplit->setVisible(KProtocolInfo::isKnownProtocol("stash")); + connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash); + QAction* reload = actionCollection()->addAction(QStringLiteral("reload")); reload->setText(i18nc("@action:inmenu View", "Reload")); actionCollection()->setDefaultShortcut(reload, Qt::Key_F5); |
