mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Added the GUI button for quick stashing
This commit is contained in:
parent
67099640b9
commit
2704b3693f
|
@ -524,6 +524,12 @@ void DolphinMainWindow::toggleSplitView()
|
|||
updateViewActions();
|
||||
}
|
||||
|
||||
void DolphinMainWindow::toggleSplitStash()
|
||||
{
|
||||
DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
|
||||
tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled(), true);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::reloadView()
|
||||
{
|
||||
clearStatusBar();
|
||||
|
@ -1040,6 +1046,13 @@ 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::Key_F2);
|
||||
stashSplit->setText(i18nc("@action:intoolbar Stash", "Stash"));
|
||||
stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window"));
|
||||
stashSplit->setCheckable(true);
|
||||
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);
|
||||
|
@ -1521,4 +1534,3 @@ void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
|
|||
KIO::FileUndoManager::UiInterface::jobError(job);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -224,6 +224,8 @@ private slots:
|
|||
*/
|
||||
void toggleSplitView();
|
||||
|
||||
void toggleSplitStash();
|
||||
|
||||
/** Reloads the currently active view. */
|
||||
void reloadView();
|
||||
|
||||
|
@ -514,4 +516,3 @@ inline int DolphinMainWindow::getId() const
|
|||
}
|
||||
|
||||
#endif // DOLPHIN_MAINWINDOW_H
|
||||
|
||||
|
|
|
@ -71,13 +71,17 @@ bool DolphinTabPage::splitViewEnabled() const
|
|||
return m_splitViewEnabled;
|
||||
}
|
||||
|
||||
void DolphinTabPage::setSplitViewEnabled(bool enabled)
|
||||
void DolphinTabPage::setSplitViewEnabled(bool enabled, bool stash /*= false*/)
|
||||
{
|
||||
if (m_splitViewEnabled != enabled) {
|
||||
m_splitViewEnabled = enabled;
|
||||
|
||||
QUrl url;
|
||||
if (enabled) {
|
||||
const QUrl& url = m_primaryViewContainer->url();
|
||||
if (stash) {
|
||||
url = QUrl("stash:/");
|
||||
} else {
|
||||
url = m_primaryViewContainer->url();
|
||||
}
|
||||
m_secondaryViewContainer = createViewContainer(url);
|
||||
|
||||
const bool placesSelectorVisible = m_primaryViewContainer->urlNavigator()->isPlacesSelectorVisible();
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
*
|
||||
* If \a enabled is true, it creates a secondary view with the url of the primary view.
|
||||
*/
|
||||
void setSplitViewEnabled(bool enabled);
|
||||
void setSplitViewEnabled(bool enabled, bool stash = false);
|
||||
|
||||
/**
|
||||
* @return The primary view containter.
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<Action name="show_hidden_files" />
|
||||
<Separator/>
|
||||
<Action name="split_view" />
|
||||
<Action name="split_stash" />
|
||||
<Action name="reload" />
|
||||
<Action name="stop" />
|
||||
<Separator/>
|
||||
|
@ -97,6 +98,7 @@
|
|||
<Action name="edit_find"/>
|
||||
<Action name="show_preview" />
|
||||
<Action name="split_view" />
|
||||
<Action name="split_stash" />
|
||||
</ToolBar>
|
||||
<ActionProperties scheme="Default">
|
||||
<Action priority="0" name="go_back"/>
|
||||
|
|
Loading…
Reference in a new issue