diff options
| author | Antonio Prcela <[email protected]> | 2020-05-14 16:17:31 -0600 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2020-05-14 16:20:14 -0600 |
| commit | a291c5999035bb17fe764c1910c3e78ba041f8ac (patch) | |
| tree | e3942ce0cd99492b3d1e100e4dc1552e90854384 /src/dolphintabwidget.cpp | |
| parent | 8cb3521cb7b2debfeff5d983bc3eb6ada1b66537 (diff) | |
Allow to copy or move selection to the other split view
Summary:
FEATURE: 276167
Default keyboard shortcuts set to `SHIFT+F5` for `copy`, `SHIFT+F6` for `move`
Reviewers: #dolphin, elvisangelaccio, ngraham, meven, dfaure
Reviewed By: #dolphin, elvisangelaccio, ngraham, meven, dfaure
Subscribers: yurchor, kde-doc-english, dfaure, meven, kfm-devel
Tags: #dolphin, #documentation
Differential Revision: https://phabricator.kde.org/D29006
Diffstat (limited to 'src/dolphintabwidget.cpp')
| -rw-r--r-- | src/dolphintabwidget.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index fba6fe084..9fd600567 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -320,6 +320,40 @@ void DolphinTabWidget::restoreClosedTab(const QByteArray& state) currentTabPage()->restoreState(state); } +void DolphinTabWidget::copyToInactiveSplitView() +{ + const DolphinTabPage* tabPage = tabPageAt(currentIndex()); + DolphinViewContainer* activeViewContainer = currentTabPage()->activeViewContainer(); + if (!tabPage->splitViewEnabled() || activeViewContainer->view()->selectedItems().isEmpty()) { + return; + } + + if (tabPage->primaryViewActive()) { + // copy from left panel to right + activeViewContainer->view()->copySelectedItemsToInactiveSplitView(activeViewContainer->view()->selectedItems(), tabPage->secondaryViewContainer()->url()); + } else { + // copy from right panel to left + activeViewContainer->view()->copySelectedItemsToInactiveSplitView(activeViewContainer->view()->selectedItems(), tabPage->primaryViewContainer()->url()); + } +} + +void DolphinTabWidget::moveToInactiveSplitView() +{ + const DolphinTabPage* tabPage = tabPageAt(currentIndex()); + DolphinViewContainer* activeViewContainer = currentTabPage()->activeViewContainer(); + if (!tabPage->splitViewEnabled() || activeViewContainer->view()->selectedItems().isEmpty()) { + return; + } + + if (tabPage->primaryViewActive()) { + // move from left panel to right + activeViewContainer->view()->moveSelectedItemsToInactiveSplitView(activeViewContainer->view()->selectedItems(), tabPage->secondaryViewContainer()->url()); + } else { + // move from right panel to left + activeViewContainer->view()->moveSelectedItemsToInactiveSplitView(activeViewContainer->view()->selectedItems(), tabPage->primaryViewContainer()->url()); + } +} + void DolphinTabWidget::detachTab(int index) { Q_ASSERT(index >= 0); |
