]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Set initial size corectly
[dolphin.git] / src / dolphinmainwindow.cpp
index c63b395a309ddda9af11e1e6fbb511cee3727d2e..e9c0c3813f5e5b55b7414381475e2b9f624844c2 100644 (file)
@@ -1,39 +1,29 @@
-/***************************************************************************
- *   Copyright (C) 2006 by Peter Penz <peter.penz19@gmail.com>             *
- *   Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com>               *
- *   Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com>       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2006 Peter Penz <peter.penz19@gmail.com>
+ * SPDX-FileCopyrightText: 2006 Stefan Monov <logixoul@gmail.com>
+ * SPDX-FileCopyrightText: 2006 Cvetoslav Ludmiloff <ludmiloff@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "dolphinmainwindow.h"
 
+#include "dolphinmainwindowadaptor.h"
+#include "config-terminal.h"
 #include "global.h"
+#include "dolphinbookmarkhandler.h"
 #include "dolphindockwidget.h"
 #include "dolphincontextmenu.h"
+#include "dolphinnavigatorswidgetaction.h"
 #include "dolphinnewfilemenu.h"
-#include "dolphinplacesmodelsingleton.h"
 #include "dolphinrecenttabsmenu.h"
-#include "dolphintabwidget.h"
+#include "dolphinurlnavigatorscontroller.h"
 #include "dolphinviewcontainer.h"
 #include "dolphintabpage.h"
 #include "middleclickactioneventfilter.h"
 #include "panels/folders/folderspanel.h"
+#include "panels/places/placesitemmodel.h"
 #include "panels/places/placespanel.h"
-#include "panels/information/informationpanel.h"
 #include "panels/terminal/terminalpanel.h"
 #include "settings/dolphinsettingsdialog.h"
 #include "statusbar/dolphinstatusbar.h"
 #include <KActionMenu>
 #include <KAuthorized>
 #include <KConfig>
+#include <KConfigGui>
+#include <KDualAction>
 #include <KFileItemListProperties>
-#include <KFilePlacesModel>
 #include <KHelpMenu>
+#include <KIO/CommandLauncherJob>
 #include <KIO/JobUiDelegate>
 #include <KIO/OpenFileManagerWindowJob>
+#include <KIO/OpenUrlJob>
 #include <KJobWidgets>
 #include <KLocalizedString>
 #include <KMessageBox>
+#include <KNS3/KMoreToolsMenuFactory>
 #include <KProtocolInfo>
 #include <KProtocolManager>
-#include <KRun>
 #include <KShell>
 #include <KStandardAction>
+#include <KStartupInfo>
+#include <KSycoca>
 #include <KToggleAction>
 #include <KToolBar>
+#include <KToolBarPopupAction>
 #include <KToolInvocation>
 #include <KUrlComboBox>
 #include <KUrlNavigator>
+#include <KWindowSystem>
+#include <KXMLGUIFactory>
 
 #include <QApplication>
 #include <QClipboard>
 #include <QCloseEvent>
+#include <QDesktopServices>
 #include <QDialog>
+#include <QDomDocument>
 #include <QFileInfo>
 #include <QLineEdit>
-#include <QMenu>
 #include <QMenuBar>
 #include <QPushButton>
 #include <QShowEvent>
 #include <QStandardPaths>
 #include <QTimer>
 #include <QToolButton>
-#include <kdualaction.h>
+#include <QWhatsThisClickedEvent>
 
 namespace {
     // Used for GeneralSettings::version() to determine whether
     // an updated version of Dolphin is running.
-    const int CurrentDolphinVersion = 200;
+    const int CurrentDolphinVersion = 201;
+    // The maximum number of entries in the back/forward popup menu
+    const int MaxNumberOfNavigationentries = 12;
+    // The maximum number of "Activate Tab" shortcuts
+    const int MaxActivateTabShortcuts = 9;
 }
 
 DolphinMainWindow::DolphinMainWindow() :
     KXmlGuiWindow(nullptr),
     m_newFileMenu(nullptr),
+    m_helpMenu(nullptr),
     m_tabWidget(nullptr),
     m_activeViewContainer(nullptr),
     m_actionHandler(nullptr),
     m_remoteEncoding(nullptr),
     m_settingsDialog(),
+    m_bookmarkHandler(nullptr),
     m_controlButton(nullptr),
     m_updateToolBarTimer(nullptr),
-    m_lastHandleUrlStatJob(nullptr),
+    m_lastHandleUrlOpenJob(nullptr),
     m_terminalPanel(nullptr),
     m_placesPanel(nullptr),
-    m_tearDownFromPlacesRequested(false)
+    m_tearDownFromPlacesRequested(false),
+    m_backAction(nullptr),
+    m_forwardAction(nullptr)
 {
     Q_INIT_RESOURCE(dolphin);
+
+    new MainWindowAdaptor(this);
+
+#ifndef Q_OS_WIN
+       setWindowFlags(Qt::WindowContextHelpButtonHint);
+#endif
     setComponentName(QStringLiteral("dolphin"), QGuiApplication::applicationDisplayName());
     setObjectName(QStringLiteral("Dolphin#"));
 
@@ -113,7 +126,7 @@ DolphinMainWindow::DolphinMainWindow() :
     KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
     undoManager->setUiInterface(new UndoUiInterface());
 
-    connect(undoManager, static_cast<void(KIO::FileUndoManager::*)(bool)>(&KIO::FileUndoManager::undoAvailable),
+    connect(undoManager, QOverload<bool>::of(&KIO::FileUndoManager::undoAvailable),
             this, &DolphinMainWindow::slotUndoAvailable);
     connect(undoManager, &KIO::FileUndoManager::undoTextChanged,
             this, &DolphinMainWindow::slotUndoTextChanged);
@@ -122,29 +135,30 @@ DolphinMainWindow::DolphinMainWindow() :
     connect(undoManager, &KIO::FileUndoManager::jobRecordingFinished,
             this, &DolphinMainWindow::showCommand);
 
-    GeneralSettings* generalSettings = GeneralSettings::self();
-    const bool firstRun = (generalSettings->version() < 200);
+    const bool firstRun = (GeneralSettings::version() < 200);
     if (firstRun) {
-        generalSettings->setViewPropsTimestamp(QDateTime::currentDateTime());
+        GeneralSettings::setViewPropsTimestamp(QDateTime::currentDateTime());
     }
 
     setAcceptDrops(true);
 
-    m_tabWidget = new DolphinTabWidget(this);
+    auto *navigatorsWidgetAction = new DolphinNavigatorsWidgetAction(this);
+    actionCollection()->addAction(QStringLiteral("url_navigators"), navigatorsWidgetAction);
+    m_tabWidget = new DolphinTabWidget(navigatorsWidgetAction, this);
     m_tabWidget->setObjectName("tabWidget");
     connect(m_tabWidget, &DolphinTabWidget::activeViewChanged,
             this, &DolphinMainWindow::activeViewChanged);
     connect(m_tabWidget, &DolphinTabWidget::tabCountChanged,
             this, &DolphinMainWindow::tabCountChanged);
     connect(m_tabWidget, &DolphinTabWidget::currentUrlChanged,
-            this, &DolphinMainWindow::setUrlAsCaption);
+            this, &DolphinMainWindow::updateWindowTitle);
     setCentralWidget(m_tabWidget);
 
     setupActions();
 
     m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
     connect(m_actionHandler, &DolphinViewActionHandler::actionBeingHandled, this, &DolphinMainWindow::clearStatusBar);
-    connect(m_actionHandler, &DolphinViewActionHandler::createDirectory, this, &DolphinMainWindow::createDirectory);
+    connect(m_actionHandler, &DolphinViewActionHandler::createDirectoryTriggered, this, &DolphinMainWindow::createDirectory);
 
     m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
     connect(this, &DolphinMainWindow::urlChanged,
@@ -159,42 +173,117 @@ DolphinMainWindow::DolphinMainWindow() :
     connect(clipboard, &QClipboard::dataChanged,
             this, &DolphinMainWindow::updatePasteAction);
 
-    QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar"));
-    showFilterBarAction->setChecked(generalSettings->filterBar());
+    QAction* toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter"));
+    toggleFilterBarAction->setChecked(GeneralSettings::filterBar());
 
     if (firstRun) {
         menuBar()->setVisible(false);
-        // Assure a proper default size if Dolphin runs the first time
-        resize(750, 500);
     }
 
     const bool showMenu = !menuBar()->isHidden();
     QAction* showMenuBarAction = actionCollection()->action(KStandardAction::name(KStandardAction::ShowMenubar));
     showMenuBarAction->setChecked(showMenu);  // workaround for bug #171080
-    if (!showMenu) {
-        createControlButton();
+
+    auto hamburgerMenu = static_cast<KHamburgerMenu *>(actionCollection()->action(
+                                    KStandardAction::name(KStandardAction::HamburgerMenu)));
+    hamburgerMenu->setMenuBar(menuBar());
+    hamburgerMenu->setMenuBarAdvertised(false); // This line will soon be removed when the
+                                                // hamburger menu contents are re-arranged.
+    connect(hamburgerMenu, &KHamburgerMenu::aboutToShowMenu,
+            this, &DolphinMainWindow::updateHamburgerMenu);
+    hamburgerMenu->hideActionsOf(toolBar());
+    if (GeneralSettings::version() < 201 && !toolBar()->actions().contains(hamburgerMenu)) {
+        addHamburgerMenuToToolbar();
     }
 
+    updateAllowedToolbarAreas();
+
     // enable middle-click on back/forward/up to open in a new tab
     auto *middleClickEventFilter = new MiddleClickActionEventFilter(this);
     connect(middleClickEventFilter, &MiddleClickActionEventFilter::actionMiddleClicked, this, &DolphinMainWindow::slotToolBarActionMiddleClicked);
     toolBar()->installEventFilter(middleClickEventFilter);
+
+    setupWhatsThis();
+
+    connect(KSycoca::self(), QOverload<>::of(&KSycoca::databaseChanged), this, &DolphinMainWindow::updateOpenPreferredSearchToolAction);
+
+    QTimer::singleShot(0, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction);
 }
 
 DolphinMainWindow::~DolphinMainWindow()
 {
 }
 
+QVector<DolphinViewContainer*> DolphinMainWindow::viewContainers() const
+{
+    QVector<DolphinViewContainer*> viewContainers;
+
+    for (int i = 0; i < m_tabWidget->count(); ++i) {
+        DolphinTabPage *tabPage = m_tabWidget->tabPageAt(i);
+
+        viewContainers << tabPage->primaryViewContainer();
+        if (tabPage->splitViewEnabled()) {
+            viewContainers << tabPage->secondaryViewContainer();
+        }
+    }
+    return viewContainers;
+}
+
+void DolphinMainWindow::setViewsWithInvalidPathsToHome()
+{
+    const QVector<DolphinViewContainer*> theViewContainers = viewContainers();
+    for (DolphinViewContainer *viewContainer : theViewContainers) {
+
+        // Only consider local dirs, not remote locations and abstract protocols
+        if (viewContainer->url().isLocalFile()) {
+            if (!QFileInfo::exists(viewContainer->url().toLocalFile())) {
+                viewContainer->setUrl(QUrl::fromLocalFile(QDir::homePath()));
+            }
+        }
+    }
+}
+
 void DolphinMainWindow::openDirectories(const QList<QUrl>& dirs, bool splitView)
 {
     m_tabWidget->openDirectories(dirs, splitView);
 }
 
+void DolphinMainWindow::openDirectories(const QStringList& dirs, bool splitView)
+{
+    openDirectories(QUrl::fromStringList(dirs), splitView);
+}
+
 void DolphinMainWindow::openFiles(const QList<QUrl>& files, bool splitView)
 {
     m_tabWidget->openFiles(files, splitView);
 }
 
+bool DolphinMainWindow::isFoldersPanelEnabled() const
+{
+    return actionCollection()->action(QStringLiteral("show_folders_panel"))->isChecked();
+}
+
+bool DolphinMainWindow::isInformationPanelEnabled() const
+{
+#ifdef HAVE_BALOO
+    return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
+#else
+    return false;
+#endif
+}
+
+void DolphinMainWindow::openFiles(const QStringList& files, bool splitView)
+{
+    openFiles(QUrl::fromStringList(files), splitView);
+}
+
+void DolphinMainWindow::activateWindow()
+{
+    window()->setAttribute(Qt::WA_NativeWindow, true);
+    KStartupInfo::setNewStartupId(window()->windowHandle(), KStartupInfo::startupId());
+    KWindowSystem::activateWindow(window()->effectiveWinId());
+}
+
 void DolphinMainWindow::showCommand(CommandType command)
 {
     DolphinStatusBar* statusBar = m_activeViewContainer->statusBar();
@@ -239,12 +328,12 @@ void DolphinMainWindow::changeUrl(const QUrl &url)
     }
 
     m_activeViewContainer->setUrl(url);
-    updateEditActions();
+    updateFileAndEditActions();
     updatePasteAction();
     updateViewActions();
     updateGoActions();
 
-    emit urlChanged(url);
+    Q_EMIT urlChanged(url);
 }
 
 void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url)
@@ -268,7 +357,7 @@ void DolphinMainWindow::slotEditableStateChanged(bool editable)
 
 void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
 {
-    updateEditActions();
+    updateFileAndEditActions();
 
     const int selectedUrlsCount = m_tabWidget->currentTabPage()->selectedItemsCount();
 
@@ -279,31 +368,34 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
         compareFilesAction->setEnabled(false);
     }
 
-    emit selectionChanged(selection);
+    Q_EMIT selectionChanged(selection);
 }
 
 void DolphinMainWindow::updateHistory()
 {
-    const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
+    const KUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigatorInternalWithHistory();
     const int index = urlNavigator->historyIndex();
 
     QAction* backAction = actionCollection()->action(KStandardAction::name(KStandardAction::Back));
     if (backAction) {
         backAction->setToolTip(i18nc("@info", "Go back"));
+        backAction->setWhatsThis(i18nc("@info:whatsthis go back", "Return to the previously viewed folder."));
         backAction->setEnabled(index < urlNavigator->historySize() - 1);
     }
 
     QAction* forwardAction = actionCollection()->action(KStandardAction::name(KStandardAction::Forward));
     if (forwardAction) {
         forwardAction->setToolTip(i18nc("@info", "Go forward"));
+        forwardAction->setWhatsThis(xi18nc("@info:whatsthis go forward",
+            "This undoes a <interface>Go|Back</interface> action."));
         forwardAction->setEnabled(index > 0);
     }
 }
 
 void DolphinMainWindow::updateFilterBarAction(bool show)
 {
-    QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar"));
-    showFilterBarAction->setChecked(show);
+    QAction* toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter"));
+    toggleFilterBarAction->setChecked(show);
 }
 
 void DolphinMainWindow::openNewMainWindow()
@@ -313,12 +405,42 @@ void DolphinMainWindow::openNewMainWindow()
 
 void DolphinMainWindow::openNewActivatedTab()
 {
+    // keep browsers compatibility, new tab is always after last one
+    auto openNewTabAfterLastTabConfigured = GeneralSettings::openNewTabAfterLastTab();
+    GeneralSettings::setOpenNewTabAfterLastTab(true);
     m_tabWidget->openNewActivatedTab();
+    GeneralSettings::setOpenNewTabAfterLastTab(openNewTabAfterLastTabConfigured);
+}
+
+void DolphinMainWindow::addToPlaces()
+{
+    QUrl url;
+    QString name;
+
+    // If nothing is selected, act on the current dir
+    if (m_activeViewContainer->view()->selectedItems().isEmpty()) {
+        url = m_activeViewContainer->url();
+        name = m_activeViewContainer->placesText();
+    } else {
+        const auto dirToAdd = m_activeViewContainer->view()->selectedItems().first();
+        url = dirToAdd.url();
+        name = dirToAdd.name();
+    }
+    if (url.isValid()) {
+        PlacesItemModel model;
+        QString icon;
+        if (m_activeViewContainer->isSearchModeEnabled()) {
+            icon = QStringLiteral("folder-saved-search-symbolic");
+        } else {
+            icon = KIO::iconNameForUrl(url);
+        }
+        model.createPlacesItem(name, url, icon);
+    }
 }
 
 void DolphinMainWindow::openNewTab(const QUrl& url)
 {
-    m_tabWidget->openNewTab(url);
+    m_tabWidget->openNewTab(url, QUrl());
 }
 
 void DolphinMainWindow::openInNewTab()
@@ -326,7 +448,7 @@ void DolphinMainWindow::openInNewTab()
     const KFileItemList& list = m_activeViewContainer->view()->selectedItems();
     bool tabCreated = false;
 
-    foreach (const KFileItem& item, list) {
+    for (const KFileItem& item : list) {
         const QUrl& url = DolphinView::openItemAsFolderUrl(item);
         if (!url.isEmpty()) {
             openNewTab(url);
@@ -392,7 +514,10 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
         closedByUser = false;
     }
 
-    if (m_tabWidget->count() > 1 && GeneralSettings::confirmClosingMultipleTabs() && closedByUser) {
+    if (m_tabWidget->count() > 1
+        && GeneralSettings::confirmClosingMultipleTabs()
+        && !GeneralSettings::rememberOpenedTabs()
+        && closedByUser) {
         // Ask the user if he really wants to quit and close all tabs.
         // Open a confirmation dialog with 3 buttons:
         // QDialogButtonBox::Yes    -> Quit
@@ -409,7 +534,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
 
         bool doNotAskAgainCheckboxResult = false;
 
-        const int result = KMessageBox::createKMessageBox(dialog,
+        const auto result = KMessageBox::createKMessageBox(dialog,
             buttons,
             QMessageBox::Warning,
             i18n("You have multiple tabs open in this window, are you sure you want to quit?"),
@@ -436,6 +561,66 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
         }
     }
 
+    if (m_terminalPanel && m_terminalPanel->hasProgramRunning() && GeneralSettings::confirmClosingTerminalRunningProgram() && closedByUser) {
+        // Ask if the user really wants to quit Dolphin with a program that is still running in the Terminal panel
+        // Open a confirmation dialog with 3 buttons:
+        // QDialogButtonBox::Yes    -> Quit
+        // QDialogButtonBox::No     -> Show Terminal Panel
+        // QDialogButtonBox::Cancel -> do nothing
+        QDialog *dialog = new QDialog(this, Qt::Dialog);
+        dialog->setWindowTitle(i18nc("@title:window", "Confirmation"));
+        dialog->setModal(true);
+        auto standardButtons = QDialogButtonBox::Yes | QDialogButtonBox::Cancel;
+        if (!m_terminalPanel->isVisible()) {
+            standardButtons |= QDialogButtonBox::No;
+        }
+        QDialogButtonBox *buttons = new QDialogButtonBox(standardButtons);
+        KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KStandardGuiItem::quit());
+        if (!m_terminalPanel->isVisible()) {
+            KGuiItem::assign(
+                    buttons->button(QDialogButtonBox::No),
+                    KGuiItem(i18n("Show &Terminal Panel"), QIcon::fromTheme(QStringLiteral("dialog-scripts"))));
+        }
+        KGuiItem::assign(buttons->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
+
+        bool doNotAskAgainCheckboxResult = false;
+
+        const auto result = KMessageBox::createKMessageBox(
+                dialog,
+                buttons,
+                QMessageBox::Warning,
+                i18n("The program '%1' is still running in the Terminal panel. Are you sure you want to quit?", m_terminalPanel->runningProgramName()),
+                QStringList(),
+                i18n("Do not ask again"),
+                &doNotAskAgainCheckboxResult,
+                KMessageBox::Dangerous);
+
+        if (doNotAskAgainCheckboxResult) {
+            GeneralSettings::setConfirmClosingTerminalRunningProgram(false);
+        }
+
+        switch (result) {
+            case QDialogButtonBox::Yes:
+                // Quit
+                break;
+            case QDialogButtonBox::No:
+                actionCollection()->action("show_terminal_panel")->trigger();
+                // Do not quit, ignore quit event
+                Q_FALLTHROUGH();
+            default:
+                event->ignore();
+                return;
+        }
+    }
+
+    if (GeneralSettings::rememberOpenedTabs())  {
+        KConfigGui::setSessionConfig(QStringLiteral("dolphin"), QStringLiteral("dolphin"));
+        KConfig *config = KConfigGui::sessionConfig();
+        saveGlobalProperties(config);
+        savePropertiesInternal(config, 1);
+        config->sync();
+    }
+
     GeneralSettings::setVersion(CurrentDolphinVersion);
     GeneralSettings::self()->save();
 
@@ -456,13 +641,13 @@ void DolphinMainWindow::updateNewMenu()
 {
     m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
     m_newFileMenu->checkUpToDate();
-    m_newFileMenu->setPopupFiles(activeViewContainer()->url());
+    m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url());
 }
 
 void DolphinMainWindow::createDirectory()
 {
     m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
-    m_newFileMenu->setPopupFiles(activeViewContainer()->url());
+    m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url());
     m_newFileMenu->createDirectory();
 }
 
@@ -501,12 +686,12 @@ void DolphinMainWindow::undo()
 
 void DolphinMainWindow::cut()
 {
-    m_activeViewContainer->view()->cutSelectedItems();
+    m_activeViewContainer->view()->cutSelectedItemsToClipboard();
 }
 
 void DolphinMainWindow::copy()
 {
-    m_activeViewContainer->view()->copySelectedItems();
+    m_activeViewContainer->view()->copySelectedItemsToClipboard();
 }
 
 void DolphinMainWindow::paste()
@@ -519,6 +704,12 @@ void DolphinMainWindow::find()
     m_activeViewContainer->setSearchModeEnabled(true);
 }
 
+void DolphinMainWindow::updateSearchAction()
+{
+    QAction* toggleSearchAction = actionCollection()->action(QStringLiteral("toggle_search"));
+    toggleSearchAction->setChecked(m_activeViewContainer->isSearchModeEnabled());
+}
+
 void DolphinMainWindow::updatePasteAction()
 {
     QAction* pasteAction = actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
@@ -545,6 +736,56 @@ void DolphinMainWindow::slotToolBarActionMiddleClicked(QAction *action)
     }
 }
 
+void DolphinMainWindow::slotAboutToShowBackPopupMenu()
+{
+    const KUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigatorInternalWithHistory();
+    int entries = 0;
+    m_backAction->menu()->clear();
+    for (int i = urlNavigator->historyIndex() + 1; i < urlNavigator->historySize() && entries < MaxNumberOfNavigationentries; ++i, ++entries) {
+        QAction* action = new QAction(urlNavigator->locationUrl(i).toString(QUrl::PreferLocalFile), m_backAction->menu());
+        action->setData(i);
+        m_backAction->menu()->addAction(action);
+    }
+}
+
+void DolphinMainWindow::slotGoBack(QAction* action)
+{
+    int gotoIndex = action->data().value<int>();
+    const KUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigatorInternalWithHistory();
+    for (int i = gotoIndex - urlNavigator->historyIndex(); i > 0; --i) {
+        goBack();
+    }
+}
+
+void DolphinMainWindow::slotBackForwardActionMiddleClicked(QAction* action)
+{
+    if (action) {
+        const KUrlNavigator *urlNavigator = activeViewContainer()->urlNavigatorInternalWithHistory();
+        openNewTab(urlNavigator->locationUrl(action->data().value<int>()));
+    }
+}
+
+void DolphinMainWindow::slotAboutToShowForwardPopupMenu()
+{
+    const KUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigatorInternalWithHistory();
+    int entries = 0;
+    m_forwardAction->menu()->clear();
+    for (int i = urlNavigator->historyIndex() - 1; i >= 0 && entries < MaxNumberOfNavigationentries; --i, ++entries) {
+        QAction* action = new QAction(urlNavigator->locationUrl(i).toString(QUrl::PreferLocalFile), m_forwardAction->menu());
+        action->setData(i);
+        m_forwardAction->menu()->addAction(action);
+    }
+}
+
+void DolphinMainWindow::slotGoForward(QAction* action)
+{
+    int gotoIndex = action->data().value<int>();
+    const KUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigatorInternalWithHistory();
+    for (int i = urlNavigator->historyIndex() - gotoIndex; i > 0; --i) {
+        goForward();
+    }
+}
+
 void DolphinMainWindow::selectAll()
 {
     clearStatusBar();
@@ -553,7 +794,7 @@ void DolphinMainWindow::selectAll()
     // URL instead of all items of the view
 
     KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
-    QLineEdit* lineEdit = urlNavigator->editor()->lineEdit(); // krazy:exclude=qclasses
+    QLineEdit* lineEdit = urlNavigator->editor()->lineEdit();
     const bool selectUrl = urlNavigator->isUrlEditable() &&
                            lineEdit->hasFocus();
     if (selectUrl) {
@@ -572,7 +813,7 @@ void DolphinMainWindow::invertSelection()
 void DolphinMainWindow::toggleSplitView()
 {
     DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
-    tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled());
+    tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled(), WithAnimation);
 
     updateViewActions();
 }
@@ -580,14 +821,15 @@ void DolphinMainWindow::toggleSplitView()
 void DolphinMainWindow::toggleSplitStash()
 {
     DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
-    tabPage->setSplitViewEnabled(false);
-    tabPage->setSplitViewEnabled(true, QUrl("stash:/"));
+    tabPage->setSplitViewEnabled(false, WithAnimation);
+    tabPage->setSplitViewEnabled(true, WithAnimation, QUrl("stash:/"));
 }
 
 void DolphinMainWindow::reloadView()
 {
     clearStatusBar();
     m_activeViewContainer->reload();
+    m_activeViewContainer->statusBar()->updateSpaceInfo();
 }
 
 void DolphinMainWindow::stopLoading()
@@ -610,6 +852,15 @@ void DolphinMainWindow::showFilterBar()
     m_activeViewContainer->setFilterBarVisible(true);
 }
 
+void DolphinMainWindow::toggleFilterBar()
+{
+    const bool checked = !m_activeViewContainer->isFilterBarVisible();
+    m_activeViewContainer->setFilterBarVisible(checked);
+
+    QAction* toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter"));
+    toggleFilterBarAction->setChecked(checked);
+}
+
 void DolphinMainWindow::toggleEditLocation()
 {
     clearStatusBar();
@@ -622,18 +873,26 @@ void DolphinMainWindow::toggleEditLocation()
 void DolphinMainWindow::replaceLocation()
 {
     KUrlNavigator* navigator = m_activeViewContainer->urlNavigator();
-    navigator->setUrlEditable(true);
-    navigator->setFocus();
-
-    // select the whole text of the combo box editor
-    QLineEdit* lineEdit = navigator->editor()->lineEdit();  // krazy:exclude=qclasses
-    lineEdit->selectAll();
+    QLineEdit* lineEdit = navigator->editor()->lineEdit();
+
+    // If the text field currently has focus and everything is selected,
+    // pressing the keyboard shortcut returns the whole thing to breadcrumb mode
+    if (navigator->isUrlEditable()
+        && lineEdit->hasFocus()
+        && lineEdit->selectedText() == lineEdit->text() ) {
+        navigator->setUrlEditable(false);
+    } else {
+        navigator->setUrlEditable(true);
+        navigator->setFocus();
+        lineEdit->selectAll();
+    }
 }
 
 void DolphinMainWindow::togglePanelLockState()
 {
     const bool newLockState = !GeneralSettings::lockPanels();
-    foreach (QObject* child, children()) {
+    const auto childrenObjects = children();
+    for (QObject* child : childrenObjects) {
         DolphinDockWidget* dock = qobject_cast<DolphinDockWidget*>(child);
         if (dock) {
             dock->setLocked(newLockState);
@@ -645,14 +904,14 @@ void DolphinMainWindow::togglePanelLockState()
 
 void DolphinMainWindow::slotTerminalPanelVisibilityChanged()
 {
-    if (m_terminalPanel->isHiddenInVisibleWindow()) {
+    if (m_terminalPanel->isHiddenInVisibleWindow() && m_activeViewContainer) {
         m_activeViewContainer->view()->setFocus();
     }
 }
 
 void DolphinMainWindow::goBack()
 {
-    KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
+    DolphinUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigatorInternalWithHistory();
     urlNavigator->goBack();
 
     if (urlNavigator->locationState().isEmpty()) {
@@ -664,29 +923,29 @@ void DolphinMainWindow::goBack()
 
 void DolphinMainWindow::goForward()
 {
-    m_activeViewContainer->urlNavigator()->goForward();
+    m_activeViewContainer->urlNavigatorInternalWithHistory()->goForward();
 }
 
 void DolphinMainWindow::goUp()
 {
-    m_activeViewContainer->urlNavigator()->goUp();
+    m_activeViewContainer->urlNavigatorInternalWithHistory()->goUp();
 }
 
 void DolphinMainWindow::goHome()
 {
-    m_activeViewContainer->urlNavigator()->goHome();
+    m_activeViewContainer->urlNavigatorInternalWithHistory()->goHome();
 }
 
 void DolphinMainWindow::goBackInNewTab()
 {
-    KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigator();
+    const KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigatorInternalWithHistory();
     const int index = urlNavigator->historyIndex() + 1;
     openNewTab(urlNavigator->locationUrl(index));
 }
 
 void DolphinMainWindow::goForwardInNewTab()
 {
-    KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigator();
+    const KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigatorInternalWithHistory();
     const int index = urlNavigator->historyIndex() - 1;
     openNewTab(urlNavigator->locationUrl(index));
 }
@@ -719,37 +978,89 @@ void DolphinMainWindow::compareFiles()
     command.append("\" \"");
     command.append(urlB.toDisplayString(QUrl::PreferLocalFile));
     command.append('\"');
-    KRun::runCommand(command, QStringLiteral("Kompare"), QStringLiteral("kompare"), this);
+
+    KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(command, this);
+    job->setDesktopName(QStringLiteral("org.kde.kompare"));
+    job->start();
 }
 
 void DolphinMainWindow::toggleShowMenuBar()
 {
     const bool visible = menuBar()->isVisible();
     menuBar()->setVisible(!visible);
-    if (visible) {
-        createControlButton();
+}
+
+QPointer<QAction> DolphinMainWindow::preferredSearchTool()
+{
+    m_searchTools.clear();
+    KMoreToolsMenuFactory("dolphin/search-tools").fillMenuFromGroupingNames(
+        &m_searchTools, { "files-find" }, m_activeViewContainer->url()
+    );
+    QList<QAction*> actions = m_searchTools.actions();
+    if (actions.isEmpty()) {
+        return nullptr;
+    }
+    QAction* action = actions.first();
+    if (action->isSeparator()) {
+        return nullptr;
+    }
+    return action;
+}
+
+void DolphinMainWindow::updateOpenPreferredSearchToolAction()
+{
+    QAction* openPreferredSearchTool = actionCollection()->action(QStringLiteral("open_preferred_search_tool"));
+    if (!openPreferredSearchTool) {
+        return;
+    }
+    QPointer<QAction> tool = preferredSearchTool();
+    if (tool) {
+        openPreferredSearchTool->setVisible(true);
+        openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open %1", tool->text()));
+        openPreferredSearchTool->setIcon(tool->icon());
     } else {
-        deleteControlButton();
+        openPreferredSearchTool->setVisible(false);
+        // still visible in Shortcuts configuration window
+        openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open Preferred Search Tool"));
+        openPreferredSearchTool->setIcon(QIcon::fromTheme(QStringLiteral("search")));
     }
 }
 
-void DolphinMainWindow::openTerminal()
+void DolphinMainWindow::openPreferredSearchTool()
 {
-    QString dir(QDir::homePath());
+    QPointer<QAction> tool = preferredSearchTool();
+    if (tool) {
+        tool->trigger();
+    }
+}
 
-    // If the given directory is not local, it can still be the URL of an
-    // ioslave using UDS_LOCAL_PATH which to be converted first.
-    KIO::StatJob* statJob = KIO::mostLocalUrl(m_activeViewContainer->url());
-    KJobWidgets::setWindow(statJob, this);
-    statJob->exec();
-    QUrl url = statJob->mostLocalUrl();
+void DolphinMainWindow::openTerminal()
+{
+    const QUrl url = m_activeViewContainer->url();
 
-    //If the URL is local after the above conversion, set the directory.
     if (url.isLocalFile()) {
-        dir = url.toLocalFile();
+        KToolInvocation::invokeTerminal(QString(), {}, url.toLocalFile());
+        return;
     }
 
-    KToolInvocation::invokeTerminal(QString(), dir);
+     // Not a local file, with protocol Class ":local", try stat'ing
+    if (KProtocolInfo::protocolClass(url.scheme()) == QLatin1String(":local")) {
+        KIO::StatJob *job = KIO::mostLocalUrl(url);
+        KJobWidgets::setWindow(job, this);
+        connect(job, &KJob::result, this, [job]() {
+            QUrl statUrl;
+            if (!job->error()) {
+                statUrl = job->mostLocalUrl();
+            }
+
+            KToolInvocation::invokeTerminal(QString(), {}, statUrl.isLocalFile() ? statUrl.toLocalFile() : QDir::homePath());
+        });
+
+        return;
+    }
+
+    // Nothing worked, just use $HOME
+    KToolInvocation::invokeTerminal(QString(), {}, QDir::homePath());
 }
 
 void DolphinMainWindow::editSettings()
@@ -759,8 +1070,10 @@ void DolphinMainWindow::editSettings()
         container->view()->writeSettings();
 
         const QUrl url = container->url();
-        DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
+        DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this, actionCollection());
         connect(settingsDialog, &DolphinSettingsDialog::settingsChanged, this, &DolphinMainWindow::refreshViews);
+        connect(settingsDialog, &DolphinSettingsDialog::settingsChanged,
+                &DolphinUrlNavigatorsController::slotReadSettings);
         settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
         settingsDialog->show();
         m_settingsDialog = settingsDialog;
@@ -771,40 +1084,39 @@ void DolphinMainWindow::editSettings()
 
 void DolphinMainWindow::handleUrl(const QUrl& url)
 {
-    delete m_lastHandleUrlStatJob;
-    m_lastHandleUrlStatJob = nullptr;
+    delete m_lastHandleUrlOpenJob;
+    m_lastHandleUrlOpenJob = nullptr;
 
     if (url.isLocalFile() && QFileInfo(url.toLocalFile()).isDir()) {
         activeViewContainer()->setUrl(url);
-    } else if (KProtocolManager::supportsListing(url)) {
-        // stat the URL to see if it is a dir or not
-        m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
-        if (m_lastHandleUrlStatJob->uiDelegate()) {
-            KJobWidgets::setWindow(m_lastHandleUrlStatJob, this);
-        }
-        connect(m_lastHandleUrlStatJob, &KIO::Job::result,
-                this, &DolphinMainWindow::slotHandleUrlStatFinished);
-
-    } else {
-        new KRun(url, this); // Automatically deletes itself after being finished
-    }
-}
-
-void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job)
-{
-    m_lastHandleUrlStatJob = nullptr;
-    const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult();
-    const QUrl url = static_cast<KIO::StatJob*>(job)->url();
-    if (entry.isDir()) {
-        activeViewContainer()->setUrl(url);
     } else {
-        new KRun(url, this);  // Automatically deletes itself after being finished
+        m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url);
+        m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+        m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true);
+
+        connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this,
+                [this, url](const QString &mimetype) {
+                    if (mimetype == QLatin1String("inode/directory")) {
+                        // If it's a dir, we'll take it from here
+                        m_lastHandleUrlOpenJob->kill();
+                        m_lastHandleUrlOpenJob = nullptr;
+                        activeViewContainer()->setUrl(url);
+                    }
+        });
+
+        connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::result, this, [this]() {
+            m_lastHandleUrlOpenJob = nullptr;
+        });
+
+        m_lastHandleUrlOpenJob->start();
     }
 }
 
 void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable)
 {
-    newFileMenu()->setEnabled(isFolderWritable);
+    // trash:/ is writable but we don't want to create new items in it.
+    // TODO: remove the trash check once https://phabricator.kde.org/T8234 is implemented
+    newFileMenu()->setEnabled(isFolderWritable && m_activeViewContainer->url().scheme() != QLatin1String("trash"));
 }
 
 void DolphinMainWindow::openContextMenu(const QPoint& pos,
@@ -842,101 +1154,67 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
     }
 }
 
-void DolphinMainWindow::updateControlMenu()
+void DolphinMainWindow::updateHamburgerMenu()
 {
-    QMenu* menu = qobject_cast<QMenu*>(sender());
-    Q_ASSERT(menu);
+    KActionCollection* ac = actionCollection();
+    auto hamburgerMenu = static_cast<KHamburgerMenu *>(
+                    ac->action(KStandardAction::name(KStandardAction::HamburgerMenu)));
+    auto menu = hamburgerMenu->menu();
+    if (!menu) {
+        menu = new QMenu(this);
+        hamburgerMenu->setMenu(menu);
+    } else {
+        menu->clear();
+    }
 
-    // All actions get cleared by QMenu::clear(). This includes the sub-menus
-    // because 'menu' is their parent.
-    menu->clear();
+    menu->addMenu(m_newFileMenu->menu());
+    menu->addAction(ac->action(QStringLiteral("file_new")));
+    menu->addAction(ac->action(QStringLiteral("new_tab")));
+    menu->addAction(ac->action(QStringLiteral("closed_tabs")));
 
-    KActionCollection* ac = actionCollection();
+    menu->addSeparator();
 
     // Add "Edit" actions
-    bool added = addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Undo)), menu) |
-                 addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Find)), menu) |
-                 addActionToMenu(ac->action(KStandardAction::name(KStandardAction::SelectAll)), menu) |
-                 addActionToMenu(ac->action(QStringLiteral("invert_selection")), menu);
+    menu->addAction(ac->action(KStandardAction::name(KStandardAction::Undo)));
+    menu->addAction(ac->action(QString("copy_location")));
+    menu->addAction(ac->action(QStringLiteral("copy_to_inactive_split_view")));
+    menu->addAction(ac->action(QStringLiteral("move_to_inactive_split_view")));
+    menu->addAction(ac->action(KStandardAction::name(KStandardAction::SelectAll)));
+    menu->addAction(ac->action(QStringLiteral("invert_selection")));
 
-    if (added) {
-        menu->addSeparator();
-    }
+    menu->addSeparator();
 
     // Add "View" actions
     if (!GeneralSettings::showZoomSlider()) {
-        addActionToMenu(ac->action(KStandardAction::name(KStandardAction::ZoomIn)), menu);
-        addActionToMenu(ac->action(KStandardAction::name(KStandardAction::ZoomOut)), menu);
+        menu->addAction(ac->action(KStandardAction::name(KStandardAction::ZoomIn)));
+        menu->addAction(ac->action(QStringLiteral("view_zoom_reset")));
+        menu->addAction(ac->action(KStandardAction::name(KStandardAction::ZoomOut)));
         menu->addSeparator();
     }
 
-    added = addActionToMenu(ac->action(QStringLiteral("view_mode")), menu) |
-            addActionToMenu(ac->action(QStringLiteral("sort")), menu) |
-            addActionToMenu(ac->action(QStringLiteral("additional_info")), menu) |
-            addActionToMenu(ac->action(QStringLiteral("show_preview")), menu) |
-            addActionToMenu(ac->action(QStringLiteral("show_in_groups")), menu) |
-            addActionToMenu(ac->action(QStringLiteral("show_hidden_files")), menu);
-
-    if (added) {
-        menu->addSeparator();
-    }
-
-    added = addActionToMenu(ac->action(QStringLiteral("split_view")), menu) |
-            addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Redisplay)), menu) |
-            addActionToMenu(ac->action(QStringLiteral("view_properties")), menu);
-    if (added) {
-        menu->addSeparator();
-    }
-
-    addActionToMenu(ac->action(QStringLiteral("panels")), menu);
-    QMenu* locationBarMenu = new QMenu(i18nc("@action:inmenu", "Location Bar"), menu);
-    locationBarMenu->addAction(ac->action(QStringLiteral("editable_location")));
-    locationBarMenu->addAction(ac->action(QStringLiteral("replace_location")));
-    menu->addMenu(locationBarMenu);
+    menu->addAction(ac->action(QStringLiteral("show_preview")));
+    menu->addAction(ac->action(QStringLiteral("show_in_groups")));
+    menu->addAction(ac->action(QStringLiteral("show_hidden_files")));
+    menu->addAction(ac->action(QStringLiteral("additional_info")));
+    menu->addAction(ac->action(QStringLiteral("view_properties")));
 
     menu->addSeparator();
 
-    // Add "Go" menu
-    QMenu* goMenu = new QMenu(i18nc("@action:inmenu", "Go"), menu);
-    goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Back)));
-    goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Forward)));
-    goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Up)));
-    goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Home)));
-    goMenu->addAction(ac->action(QStringLiteral("closed_tabs")));
-    menu->addMenu(goMenu);
-
-    // Add "Tool" menu
-    QMenu* toolsMenu = new QMenu(i18nc("@action:inmenu", "Tools"), menu);
-    toolsMenu->addAction(ac->action(QStringLiteral("show_filter_bar")));
-    toolsMenu->addAction(ac->action(QStringLiteral("compare_files")));
-    toolsMenu->addAction(ac->action(QStringLiteral("open_terminal")));
-    toolsMenu->addAction(ac->action(QStringLiteral("change_remote_encoding")));
-    menu->addMenu(toolsMenu);
-
-    // Add "Settings" menu entries
-    addActionToMenu(ac->action(KStandardAction::name(KStandardAction::KeyBindings)), menu);
-    addActionToMenu(ac->action(KStandardAction::name(KStandardAction::ConfigureToolbars)), menu);
-    addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Preferences)), menu);
-
-    // Add "Help" menu
-    auto helpMenu = new KHelpMenu(menu);
-    menu->addMenu(helpMenu->menu());
+    // Add a curated assortment of items from the "Tools" menu
+    menu->addAction(ac->action(QStringLiteral("show_filter_bar")));
+    menu->addAction(ac->action(QStringLiteral("open_preferred_search_tool")));
+    menu->addAction(ac->action(QStringLiteral("open_terminal")));
 
     menu->addSeparator();
-    addActionToMenu(ac->action(KStandardAction::name(KStandardAction::ShowMenubar)), menu);
-}
 
-void DolphinMainWindow::updateToolBar()
-{
-    if (!menuBar()->isVisible()) {
-        createControlButton();
-    }
-}
+    // Add "Show Panels" menu
+    menu->addAction(ac->action(QStringLiteral("panels")));
 
-void DolphinMainWindow::slotControlButtonDeleted()
-{
-    m_controlButton = nullptr;
-    m_updateToolBarTimer->start();
+    // Add "Settings" menu entries
+    menu->addAction(ac->action(KStandardAction::name(KStandardAction::KeyBindings)));
+    menu->addAction(ac->action(KStandardAction::name(KStandardAction::ConfigureToolbars)));
+    menu->addAction(ac->action(KStandardAction::name(KStandardAction::Preferences)));
+    menu->addAction(ac->action(KStandardAction::name(KStandardAction::ShowMenubar)));
 }
 
 void DolphinMainWindow::slotPlaceActivated(const QUrl& url)
@@ -948,7 +1226,9 @@ void DolphinMainWindow::slotPlaceActivated(const QUrl& url)
         // which had been unmounted earlier, see https://bugs.kde.org/show_bug.cgi?id=161385.
         reloadView();
     } else {
+        view->disableUrlNavigatorSelectionRequests();
         changeUrl(url);
+        view->enableUrlNavigatorSelectionRequests();
     }
 }
 
@@ -965,11 +1245,23 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
     m_activeViewContainer = viewContainer;
 
     if (oldViewContainer) {
+        const QAction* toggleSearchAction = actionCollection()->action(QStringLiteral("toggle_search"));
+        toggleSearchAction->disconnect(oldViewContainer);
+
         // Disconnect all signals between the old view container (container,
         // view and url navigator) and main window.
         oldViewContainer->disconnect(this);
         oldViewContainer->view()->disconnect(this);
-        oldViewContainer->urlNavigator()->disconnect(this);
+        auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
+                          (actionCollection()->action(QStringLiteral("url_navigators")));
+        navigators->primaryUrlNavigator()->disconnect(this);
+        if (auto secondaryUrlNavigator = navigators->secondaryUrlNavigator()) {
+            secondaryUrlNavigator->disconnect(this);
+        }
+
+        // except the requestItemInfo so that on hover the information panel can still be updated
+        connect(oldViewContainer->view(), &DolphinView::requestItemInfo,
+                this, &DolphinMainWindow::requestItemInfo);
     }
 
     connectViewSignals(viewContainer);
@@ -977,68 +1269,42 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
     m_actionHandler->setCurrentView(viewContainer->view());
 
     updateHistory();
-    updateEditActions();
+    updateFileAndEditActions();
     updatePasteAction();
     updateViewActions();
     updateGoActions();
+    updateSearchAction();
 
     const QUrl url = viewContainer->url();
-    emit urlChanged(url);
+    Q_EMIT urlChanged(url);
 }
 
 void DolphinMainWindow::tabCountChanged(int count)
 {
     const bool enableTabActions = (count > 1);
-    actionCollection()->action(KStandardAction::name(KStandardAction::Close))->setEnabled(enableTabActions);
+    for (int i = 0; i < MaxActivateTabShortcuts; ++i) {
+        actionCollection()->action(QStringLiteral("activate_tab_%1").arg(i))->setEnabled(enableTabActions);
+    }
+    actionCollection()->action(QStringLiteral("activate_last_tab"))->setEnabled(enableTabActions);
     actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions);
     actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions);
 }
 
-void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
+void DolphinMainWindow::updateWindowTitle()
 {
-    QString schemePrefix;
-    if (!url.isLocalFile()) {
-        schemePrefix.append(url.scheme() + " - ");
-        if (!url.host().isEmpty()) {
-            schemePrefix.append(url.host() + " - ");
-        }
-    }
-
-    if (GeneralSettings::showFullPathInTitlebar()) {
-        const QString path = url.adjusted(QUrl::StripTrailingSlash).path();
-        setWindowTitle(schemePrefix + path);
-        return;
+    const QString newTitle = m_activeViewContainer->captionWindowTitle();
+    if (windowTitle() != newTitle) {
+        setWindowTitle(newTitle);
     }
-
-    KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
-    const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, url, 1, Qt::MatchExactly);
-
-    if (!matchedPlaces.isEmpty()) {
-        setWindowTitle(placesModel->text(matchedPlaces.first()));
-        return;
-    }
-
-    QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
-    if (fileName.isEmpty()) {
-        fileName = '/';
-    }
-
-    if (m_activeViewContainer->isSearchModeEnabled()) {
-        if(m_activeViewContainer->currentSearchText().isEmpty()){
-            setWindowTitle(i18n("Search"));
-        } else {
-            const auto searchText = i18n("Search for %1", m_activeViewContainer->currentSearchText());
-            setWindowTitle(searchText);
-        }
-        return;
-    }
-
-    setWindowTitle(schemePrefix + fileName);
 }
 
 void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath)
 {
-    if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
+    connect(m_placesPanel, &PlacesPanel::storageTearDownSuccessful, this, [this, mountPath]() {
+        setViewsToHomeIfMountPathOpen(mountPath);
+    });
+
+    if (m_terminalPanel && m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
         m_tearDownFromPlacesRequested = true;
         m_terminalPanel->goHome();
         // m_placesPanel->proceedWithTearDown() will be called in slotTerminalDirectoryChanged
@@ -1049,14 +1315,31 @@ void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mo
 
 void DolphinMainWindow::slotStorageTearDownExternallyRequested(const QString& mountPath)
 {
-    if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
+    connect(m_placesPanel, &PlacesPanel::storageTearDownSuccessful, this, [this, mountPath]() {
+        setViewsToHomeIfMountPathOpen(mountPath);
+    });
+
+    if (m_terminalPanel && m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
         m_tearDownFromPlacesRequested = false;
         m_terminalPanel->goHome();
     }
 }
 
+void DolphinMainWindow::setViewsToHomeIfMountPathOpen(const QString& mountPath)
+{
+    const QVector<DolphinViewContainer*> theViewContainers = viewContainers();
+    for (DolphinViewContainer *viewContainer : theViewContainers) {
+        if (viewContainer && viewContainer->url().toLocalFile().startsWith(mountPath)) {
+            viewContainer->setUrl(QUrl::fromLocalFile(QDir::homePath()));
+        }
+    }
+    disconnect(m_placesPanel, &PlacesPanel::storageTearDownSuccessful, nullptr, nullptr);
+}
+
 void DolphinMainWindow::setupActions()
 {
+    KStandardAction::hamburgerMenu(nullptr, nullptr, actionCollection());
+
     // setup 'File' menu
     m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
     QMenu* menu = m_newFileMenu->menu();
@@ -1068,58 +1351,164 @@ void DolphinMainWindow::setupActions()
 
     QAction* newWindow = KStandardAction::openNew(this, &DolphinMainWindow::openNewMainWindow, actionCollection());
     newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
+    newWindow->setToolTip(i18nc("@info", "Open a new Dolphin window"));
+    newWindow->setWhatsThis(xi18nc("@info:whatsthis", "This opens a new "
+        "window just like this one with the current location and view."
+        "<nl/>You can drag and drop items between windows."));
+    newWindow->setIcon(QIcon::fromTheme(QStringLiteral("window-new")));
 
     QAction* newTab = actionCollection()->addAction(QStringLiteral("new_tab"));
     newTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-new")));
     newTab->setText(i18nc("@action:inmenu File", "New Tab"));
-    actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, QKeySequence::AddTab});
-    connect(newTab, &QAction::triggered, this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::openNewActivatedTab));
-
-    QAction* closeTab = KStandardAction::close(
-            m_tabWidget, static_cast<void(DolphinTabWidget::*)()>(&DolphinTabWidget::closeTab), actionCollection());
+    newTab->setWhatsThis(xi18nc("@info:whatsthis", "This opens a new "
+        "<emphasis>Tab</emphasis> with the current location and view.<nl/>"
+        "A tab is an additional view within this window. "
+        "You can drag and drop items between tabs."));
+    actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N});
+    connect(newTab, &QAction::triggered, this, &DolphinMainWindow::openNewActivatedTab);
+
+    QAction* addToPlaces = actionCollection()->addAction(QStringLiteral("add_to_places"));
+    addToPlaces->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-new")));
+    addToPlaces->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places"));
+    addToPlaces->setWhatsThis(xi18nc("@info:whatsthis", "This adds the selected folder "
+        "to the Places panel."));
+    connect(addToPlaces, &QAction::triggered, this, &DolphinMainWindow::addToPlaces);
+
+    QAction* closeTab = KStandardAction::close(m_tabWidget, QOverload<>::of(&DolphinTabWidget::closeTab), actionCollection());
     closeTab->setText(i18nc("@action:inmenu File", "Close Tab"));
-    closeTab->setEnabled(false);
+    closeTab->setWhatsThis(i18nc("@info:whatsthis", "This closes the "
+        "currently viewed tab. If no more tabs are left this window "
+        "will close instead."));
 
-    KStandardAction::quit(this, &DolphinMainWindow::quit, actionCollection());
+    QAction* quitAction = KStandardAction::quit(this, &DolphinMainWindow::quit, actionCollection());
+    quitAction->setWhatsThis(i18nc("@info:whatsthis quit", "This closes this window."));
 
     // setup 'Edit' menu
     KStandardAction::undo(this,
                           &DolphinMainWindow::undo,
                           actionCollection());
 
-
-    KStandardAction::cut(this, &DolphinMainWindow::cut, actionCollection());
-    KStandardAction::copy(this, &DolphinMainWindow::copy, actionCollection());
+    // i18n: This will be the last paragraph for the whatsthis for all three:
+    // Cut, Copy and Paste
+    const QString cutCopyPastePara = xi18nc("@info:whatsthis", "<para><emphasis>Cut, "
+        "Copy</emphasis> and <emphasis>Paste</emphasis> work between many "
+        "applications and are among the most used commands. That's why their "
+        "<emphasis>keyboard shortcuts</emphasis> are prominently placed right "
+        "next to each other on the keyboard: <shortcut>Ctrl+X</shortcut>, "
+        "<shortcut>Ctrl+C</shortcut> and <shortcut>Ctrl+V</shortcut>.</para>");
+    QAction* cutAction = KStandardAction::cut(this, &DolphinMainWindow::cut, actionCollection());
+    cutAction->setWhatsThis(xi18nc("@info:whatsthis cut", "This copies the items "
+        "in your current selection to the <emphasis>clipboard</emphasis>.<nl/>"
+        "Use the <emphasis>Paste</emphasis> action afterwards to copy them from "
+        "the clipboard to a new location. The items will be removed from their "
+        "initial location.") + cutCopyPastePara);
+    QAction* copyAction = KStandardAction::copy(this, &DolphinMainWindow::copy, actionCollection());
+    copyAction->setWhatsThis(xi18nc("@info:whatsthis copy", "This copies the "
+        "items in your current selection to the <emphasis>clipboard</emphasis>."
+        "<nl/>Use the <emphasis>Paste</emphasis> action afterwards to copy them "
+        "from the clipboard to a new location.") +  cutCopyPastePara);
     QAction* paste = KStandardAction::paste(this, &DolphinMainWindow::paste, actionCollection());
     // The text of the paste-action is modified dynamically by Dolphin
     // (e. g. to "Paste One Folder"). To prevent that the size of the toolbar changes
     // due to the long text, the text "Paste" is used:
     paste->setIconText(i18nc("@action:inmenu Edit", "Paste"));
+    paste->setWhatsThis(xi18nc("@info:whatsthis paste", "This copies the items from "
+        "your <emphasis>clipboard</emphasis> to the currently viewed folder.<nl/>"
+        "If the items were added to the clipboard by the <emphasis>Cut</emphasis> "
+        "action they are removed from their old location.") +  cutCopyPastePara);
+
+    QAction* copyToOtherViewAction = actionCollection()->addAction(QStringLiteral("copy_to_inactive_split_view"));
+    copyToOtherViewAction->setText(i18nc("@action:inmenu", "Copy to Inactive Split View"));
+    copyToOtherViewAction->setWhatsThis(xi18nc("@info:whatsthis Copy", "This copies the selected items from "
+        "the <emphasis>active</emphasis> view to the inactive split view."));
+    copyToOtherViewAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
+    copyToOtherViewAction->setIconText(i18nc("@action:inmenu Edit", "Copy to Inactive Split View"));
+    actionCollection()->setDefaultShortcut(copyToOtherViewAction, Qt::SHIFT | Qt::Key_F5 );
+    connect(copyToOtherViewAction, &QAction::triggered, m_tabWidget, &DolphinTabWidget::copyToInactiveSplitView);
+
+    QAction* moveToOtherViewAction = actionCollection()->addAction(QStringLiteral("move_to_inactive_split_view"));
+    moveToOtherViewAction->setText(i18nc("@action:inmenu", "Move to Inactive Split View"));
+    moveToOtherViewAction->setWhatsThis(xi18nc("@info:whatsthis Move", "This moves the selected items from "
+        "the <emphasis>active</emphasis> view to the inactive split view."));
+    moveToOtherViewAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-cut")));
+    moveToOtherViewAction->setIconText(i18nc("@action:inmenu Edit", "Move to Inactive Split View"));
+    actionCollection()->setDefaultShortcut(moveToOtherViewAction, Qt::SHIFT | Qt::Key_F6 );
+    connect(moveToOtherViewAction, &QAction::triggered, m_tabWidget, &DolphinTabWidget::moveToInactiveSplitView);
 
-    KStandardAction::find(this, &DolphinMainWindow::find, actionCollection());
+    QAction* showFilterBar = actionCollection()->addAction(QStringLiteral("show_filter_bar"));
+    showFilterBar->setText(i18nc("@action:inmenu Tools", "Filter..."));
+    showFilterBar->setToolTip(i18nc("@info:tooltip", "Toggle Filter Bar"));
+    showFilterBar->setWhatsThis(xi18nc("@info:whatsthis", "This opens the "
+        "<emphasis>Filter Bar</emphasis> at the bottom of the window.<nl/> "
+        "There you can enter a text to filter the files and folders currently displayed. "
+        "Only those that contain the text in their name will be kept in view."));
+    showFilterBar->setIcon(QIcon::fromTheme(QStringLiteral("view-filter")));
+    actionCollection()->setDefaultShortcuts(showFilterBar, {Qt::CTRL | Qt::Key_I, Qt::Key_Slash});
+    connect(showFilterBar, &QAction::triggered, this, &DolphinMainWindow::showFilterBar);
 
-    KStandardAction::selectAll(this, &DolphinMainWindow::selectAll, actionCollection());
+    // toggle_filter acts as a copy of the main showFilterBar to be used mainly
+    // in the toolbar, with no default shortcut attached, to avoid messing with
+    // existing workflows (filter bar always open and Ctrl-I to focus)
+    QAction *toggleFilter = actionCollection()->addAction(QStringLiteral("toggle_filter"));
+    toggleFilter->setText(i18nc("@action:inmenu", "Toggle Filter Bar"));
+    toggleFilter->setIconText(i18nc("@action:intoolbar", "Filter"));
+    toggleFilter->setIcon(showFilterBar->icon());
+    toggleFilter->setToolTip(showFilterBar->toolTip());
+    toggleFilter->setWhatsThis(showFilterBar->whatsThis());
+    toggleFilter->setCheckable(true);
+    connect(toggleFilter, &QAction::triggered, this, &DolphinMainWindow::toggleFilterBar);
+
+    QAction *searchAction = KStandardAction::find(this, &DolphinMainWindow::find, actionCollection());
+    searchAction->setText(i18n("Search..."));
+    searchAction->setToolTip(i18nc("@info:tooltip", "Search for files and folders"));
+    searchAction->setWhatsThis(xi18nc("@info:whatsthis find", "<para>This helps you "
+        "find files and folders by opening a <emphasis>find bar</emphasis>. "
+        "There you can enter search terms and specify settings to find the "
+        "objects you are looking for.</para><para>Use this help again on "
+        "the find bar so we can have a look at it while the settings are "
+        "explained.</para>"));
+
+    // toggle_search acts as a copy of the main searchAction to be used mainly
+    // in the toolbar, with no default shortcut attached, to avoid messing with
+    // existing workflows (search bar always open and Ctrl-F to focus)
+    QAction *toggleSearchAction = actionCollection()->addAction(QStringLiteral("toggle_search"));
+    toggleSearchAction->setText(i18nc("@action:inmenu", "Toggle Search Bar"));
+    toggleSearchAction->setIconText(i18nc("@action:intoolbar", "Search"));
+    toggleSearchAction->setIcon(searchAction->icon());
+    toggleSearchAction->setToolTip(searchAction->toolTip());
+    toggleSearchAction->setWhatsThis(searchAction->whatsThis());
+    toggleSearchAction->setCheckable(true);
+
+    QAction* selectAllAction = KStandardAction::selectAll(this, &DolphinMainWindow::selectAll, actionCollection());
+    selectAllAction->setWhatsThis(xi18nc("@info:whatsthis", "This selects all "
+        "files and folders in the current location."));
 
     QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection"));
     invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
+    invertSelection->setWhatsThis(xi18nc("@info:whatsthis invert", "This selects all "
+        "objects that you have currently <emphasis>not</emphasis> selected instead."));
     invertSelection->setIcon(QIcon::fromTheme(QStringLiteral("edit-select-invert")));
-    actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL + Qt::SHIFT + Qt::Key_A);
+    actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A);
     connect(invertSelection, &QAction::triggered, this, &DolphinMainWindow::invertSelection);
 
     // setup 'View' menu
     // (note that most of it is set up in DolphinViewActionHandler)
 
     QAction* split = actionCollection()->addAction(QStringLiteral("split_view"));
+    split->setWhatsThis(xi18nc("@info:whatsthis find", "<para>This splits "
+        "the folder view below into two autonomous views.</para><para>This "
+        "way you can see two locations at once and move items between them "
+        "quickly.</para>Click this again afterwards to recombine the views."));
     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);
+    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-stash")));
     stashSplit->setCheckable(false);
-    stashSplit->setVisible(KProtocolInfo::isKnownProtocol("stash"));
+    stashSplit->setVisible(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier")));
     connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash);
 
     KStandardAction::redisplay(this, &DolphinMainWindow::reloadView, actionCollection());
@@ -1127,24 +1516,48 @@ void DolphinMainWindow::setupActions()
     QAction* stop = actionCollection()->addAction(QStringLiteral("stop"));
     stop->setText(i18nc("@action:inmenu View", "Stop"));
     stop->setToolTip(i18nc("@info", "Stop loading"));
+    stop->setWhatsThis(i18nc("@info", "This stops the loading of the contents of the current folder."));
     stop->setIcon(QIcon::fromTheme(QStringLiteral("process-stop")));
     connect(stop, &QAction::triggered, this, &DolphinMainWindow::stopLoading);
 
     KToggleAction* editableLocation = actionCollection()->add<KToggleAction>(QStringLiteral("editable_location"));
     editableLocation->setText(i18nc("@action:inmenu Navigation Bar", "Editable Location"));
+    editableLocation->setWhatsThis(xi18nc("@info:whatsthis",
+        "This toggles the <emphasis>Location Bar</emphasis> to be "
+        "editable so you can directly enter a location you want to go to.<nl/>"
+        "You can also switch to editing by clicking to the right of the "
+        "location and switch back by confirming the edited location."));
     actionCollection()->setDefaultShortcut(editableLocation, Qt::Key_F6);
     connect(editableLocation, &KToggleAction::triggered, this, &DolphinMainWindow::toggleEditLocation);
 
     QAction* replaceLocation = actionCollection()->addAction(QStringLiteral("replace_location"));
     replaceLocation->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location"));
-    actionCollection()->setDefaultShortcut(replaceLocation, Qt::CTRL + Qt::Key_L);
+    // i18n: "enter" is used both in the meaning of "writing" and "going to" a new location here.
+    // Both meanings are useful but not necessary to understand the use of "Replace Location".
+    // So you might want to be more verbose in your language to convey the meaning but it's up to you.
+    replaceLocation->setWhatsThis(xi18nc("@info:whatsthis",
+        "This switches to editing the location and selects it "
+        "so you can quickly enter a different location."));
+    actionCollection()->setDefaultShortcut(replaceLocation, Qt::CTRL | Qt::Key_L);
     connect(replaceLocation, &QAction::triggered, this, &DolphinMainWindow::replaceLocation);
 
     // setup 'Go' menu
-    QAction* backAction = KStandardAction::back(this, &DolphinMainWindow::goBack, actionCollection());
-    auto backShortcuts = backAction->shortcuts();
+    {
+        QScopedPointer<QAction> backAction(KStandardAction::back(nullptr, nullptr, nullptr));
+        m_backAction = new KToolBarPopupAction(backAction->icon(), backAction->text(), actionCollection());
+        m_backAction->setObjectName(backAction->objectName());
+        m_backAction->setShortcuts(backAction->shortcuts());
+    }
+    m_backAction->setDelayed(true);
+    m_backAction->setStickyMenu(false);
+    connect(m_backAction, &QAction::triggered, this, &DolphinMainWindow::goBack);
+    connect(m_backAction->menu(), &QMenu::aboutToShow, this, &DolphinMainWindow::slotAboutToShowBackPopupMenu);
+    connect(m_backAction->menu(), &QMenu::triggered, this, &DolphinMainWindow::slotGoBack);
+    actionCollection()->addAction(m_backAction->objectName(), m_backAction);
+
+    auto backShortcuts = m_backAction->shortcuts();
     backShortcuts.append(QKeySequence(Qt::Key_Backspace));
-    actionCollection()->setDefaultShortcuts(backAction, backShortcuts);
+    actionCollection()->setDefaultShortcuts(m_backAction, backShortcuts);
 
     DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this);
     actionCollection()->addAction(QStringLiteral("closed_tabs"), recentTabsMenu);
@@ -1157,53 +1570,132 @@ void DolphinMainWindow::setupActions()
 
     QAction* undoCloseTab = actionCollection()->addAction(QStringLiteral("undo_close_tab"));
     undoCloseTab->setText(i18nc("@action:inmenu File", "Undo close tab"));
-    actionCollection()->setDefaultShortcut(undoCloseTab, Qt::CTRL + Qt::SHIFT + Qt::Key_T);
+    undoCloseTab->setWhatsThis(i18nc("@info:whatsthis undo close tab",
+        "This returns you to the previously closed tab."));
+    actionCollection()->setDefaultShortcut(undoCloseTab, Qt::CTRL | Qt::SHIFT | Qt::Key_T);
     undoCloseTab->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
     undoCloseTab->setEnabled(false);
     connect(undoCloseTab, &QAction::triggered, recentTabsMenu, &DolphinRecentTabsMenu::undoCloseTab);
 
     auto undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
+    undoAction->setWhatsThis(xi18nc("@info:whatsthis", "This undoes "
+        "the last change you made to files or folders.<nl/>"
+        "Such changes include <interface>creating, renaming</interface> "
+        "and <interface>moving</interface> them to a different location "
+        "or to the <filename>Trash</filename>. <nl/>Changes that can't "
+        "be undone will ask for your confirmation."));
     undoAction->setEnabled(false); // undo should be disabled by default
 
-    KStandardAction::forward(this, &DolphinMainWindow::goForward, actionCollection());
+    {
+        QScopedPointer<QAction> forwardAction(KStandardAction::forward(nullptr, nullptr, nullptr));
+        m_forwardAction = new KToolBarPopupAction(forwardAction->icon(), forwardAction->text(), actionCollection());
+        m_forwardAction->setObjectName(forwardAction->objectName());
+        m_forwardAction->setShortcuts(forwardAction->shortcuts());
+    }
+    m_forwardAction->setDelayed(true);
+    m_forwardAction->setStickyMenu(false);
+    connect(m_forwardAction, &QAction::triggered, this, &DolphinMainWindow::goForward);
+    connect(m_forwardAction->menu(), &QMenu::aboutToShow, this, &DolphinMainWindow::slotAboutToShowForwardPopupMenu);
+    connect(m_forwardAction->menu(), &QMenu::triggered, this, &DolphinMainWindow::slotGoForward);
+    actionCollection()->addAction(m_forwardAction->objectName(), m_forwardAction);
+    actionCollection()->setDefaultShortcuts(m_forwardAction, m_forwardAction->shortcuts());
+
+    // enable middle-click to open in a new tab
+    auto *middleClickEventFilter = new MiddleClickActionEventFilter(this);
+    connect(middleClickEventFilter, &MiddleClickActionEventFilter::actionMiddleClicked, this, &DolphinMainWindow::slotBackForwardActionMiddleClicked);
+    m_backAction->menu()->installEventFilter(middleClickEventFilter);
+    m_forwardAction->menu()->installEventFilter(middleClickEventFilter);
     KStandardAction::up(this, &DolphinMainWindow::goUp, actionCollection());
-    KStandardAction::home(this, &DolphinMainWindow::goHome, actionCollection());
+    QAction* homeAction = KStandardAction::home(this, &DolphinMainWindow::goHome, actionCollection());
+    homeAction->setWhatsThis(xi18nc("@info:whatsthis", "Go to your "
+        "<filename>Home</filename> folder.<nl/>Every user account "
+        "has their own <filename>Home</filename> that contains their data "
+        "including folders that contain personal application data."));
 
     // setup 'Tools' menu
-    QAction* showFilterBar = actionCollection()->addAction(QStringLiteral("show_filter_bar"));
-    showFilterBar->setText(i18nc("@action:inmenu Tools", "Show Filter Bar"));
-    showFilterBar->setIcon(QIcon::fromTheme(QStringLiteral("view-filter")));
-    actionCollection()->setDefaultShortcuts(showFilterBar, {Qt::CTRL + Qt::Key_I, Qt::Key_Slash});
-    connect(showFilterBar, &QAction::triggered, this, &DolphinMainWindow::showFilterBar);
-
     QAction* compareFiles = actionCollection()->addAction(QStringLiteral("compare_files"));
     compareFiles->setText(i18nc("@action:inmenu Tools", "Compare Files"));
     compareFiles->setIcon(QIcon::fromTheme(QStringLiteral("kompare")));
     compareFiles->setEnabled(false);
     connect(compareFiles, &QAction::triggered, this, &DolphinMainWindow::compareFiles);
 
-#ifndef Q_OS_WIN
+    QAction* openPreferredSearchTool = actionCollection()->addAction(QStringLiteral("open_preferred_search_tool"));
+    openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open Preferred Search Tool"));
+    openPreferredSearchTool->setWhatsThis(xi18nc("@info:whatsthis",
+        "<para>This opens a preferred search tool for the viewed location.</para>"
+        "<para>Use <emphasis>More Search Tools</emphasis> menu to configure it.</para>"));
+    openPreferredSearchTool->setIcon(QIcon::fromTheme(QStringLiteral("search")));
+    actionCollection()->setDefaultShortcut(openPreferredSearchTool, Qt::CTRL | Qt::SHIFT | Qt::Key_F);
+    connect(openPreferredSearchTool, &QAction::triggered, this, &DolphinMainWindow::openPreferredSearchTool);
+
     if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal"));
         openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal"));
+        openTerminal->setWhatsThis(xi18nc("@info:whatsthis",
+            "<para>This opens a <emphasis>terminal</emphasis> application for the viewed location.</para>"
+            "<para>To learn more about terminals use the help in the terminal application.</para>"));
         openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal")));
-        actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT + Qt::Key_F4);
+        actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT | Qt::Key_F4);
         connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal);
-    }
+
+#ifdef HAVE_TERMINAL
+        QAction* focusTerminalPanel = actionCollection()->addAction(QStringLiteral("focus_terminal_panel"));
+        focusTerminalPanel->setText(i18nc("@action:inmenu Tools", "Focus Terminal Panel"));
+        focusTerminalPanel->setIcon(QIcon::fromTheme(QStringLiteral("swap-panels")));
+        actionCollection()->setDefaultShortcut(focusTerminalPanel, Qt::CTRL | Qt::SHIFT | Qt::Key_F4);
+        connect(focusTerminalPanel, &QAction::triggered, this, &DolphinMainWindow::focusTerminalPanel);
 #endif
+    }
+
+    // setup 'Bookmarks' menu
+    KActionMenu *bookmarkMenu = new KActionMenu(i18nc("@title:menu", "&Bookmarks"), this);
+    bookmarkMenu->setIcon(QIcon::fromTheme(QStringLiteral("bookmarks")));
+    // Make the toolbar button version work properly on click
+    bookmarkMenu->setDelayed(false);
+    m_bookmarkHandler = new DolphinBookmarkHandler(this, actionCollection(), bookmarkMenu->menu(), this);
+    actionCollection()->addAction(QStringLiteral("bookmarks"), bookmarkMenu);
 
     // setup 'Settings' menu
     KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection());
+    showMenuBar->setWhatsThis(xi18nc("@info:whatsthis",
+            "This switches between having a <emphasis>Menubar</emphasis> "
+            "and having a <interface>Control</interface> button. Both "
+            "contain mostly the same commands and configuration options."));
     connect(showMenuBar, &KToggleAction::triggered,                   // Fixes #286822
             this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection);
     KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection());
 
+    // setup 'Help' menu for the m_controlButton. The other one is set up in the base class.
+    m_helpMenu = new KHelpMenu(nullptr);
+    m_helpMenu->menu()->installEventFilter(this);
+    // remove duplicate shortcuts
+    m_helpMenu->action(KHelpMenu::menuHelpContents)->setShortcut(QKeySequence());
+    m_helpMenu->action(KHelpMenu::menuWhatsThis)->setShortcut(QKeySequence());
+
     // not in menu actions
     QList<QKeySequence> nextTabKeys = KStandardShortcut::tabNext();
-    nextTabKeys.append(QKeySequence(Qt::CTRL + Qt::Key_Tab));
+    nextTabKeys.append(QKeySequence(Qt::CTRL | Qt::Key_Tab));
 
     QList<QKeySequence> prevTabKeys = KStandardShortcut::tabPrev();
-    prevTabKeys.append(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab));
+    prevTabKeys.append(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Tab));
+
+    for (int i = 0; i < MaxActivateTabShortcuts; ++i) {
+        QAction* activateTab = actionCollection()->addAction(QStringLiteral("activate_tab_%1").arg(i));
+        activateTab->setText(i18nc("@action:inmenu", "Activate Tab %1", i + 1));
+        activateTab->setEnabled(false);
+        connect(activateTab, &QAction::triggered, this, [this, i]() { m_tabWidget->activateTab(i); });
+
+        // only add default shortcuts for the first 9 tabs regardless of MaxActivateTabShortcuts
+        if (i < 9) {
+            actionCollection()->setDefaultShortcut(activateTab, QStringLiteral("Alt+%1").arg(i + 1));
+        }
+    }
+
+    QAction* activateLastTab = actionCollection()->addAction(QStringLiteral("activate_last_tab"));
+    activateLastTab->setText(i18nc("@action:inmenu", "Activate Last Tab"));
+    activateLastTab->setEnabled(false);
+    connect(activateLastTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activateLastTab);
+    actionCollection()->setDefaultShortcut(activateLastTab, Qt::ALT | Qt::Key_0);
 
     QAction* activateNextTab = actionCollection()->addAction(QStringLiteral("activate_next_tab"));
     activateNextTab->setIconText(i18nc("@action:inmenu", "Next Tab"));
@@ -1251,6 +1743,11 @@ void DolphinMainWindow::setupDockWidgets()
     lockLayoutAction->setActiveIcon(QIcon::fromTheme(QStringLiteral("object-unlocked")));
     lockLayoutAction->setInactiveText(i18nc("@action:inmenu Panels", "Lock Panels"));
     lockLayoutAction->setInactiveIcon(QIcon::fromTheme(QStringLiteral("object-locked")));
+    lockLayoutAction->setWhatsThis(xi18nc("@info:whatsthis", "This "
+        "switches between having panels <emphasis>locked</emphasis> or "
+        "<emphasis>unlocked</emphasis>.<nl/>Unlocked panels can be "
+        "dragged to the other side of the window and have a close "
+        "button.<nl/>Locked panels are embedded more cleanly."));
     lockLayoutAction->setActive(lock);
     connect(lockLayoutAction, &KDualAction::triggered, this, &DolphinMainWindow::togglePanelLockState);
 
@@ -1259,6 +1756,8 @@ void DolphinMainWindow::setupDockWidgets()
     infoDock->setLocked(lock);
     infoDock->setObjectName(QStringLiteral("infoDock"));
     infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+
+#ifdef HAVE_BALOO
     InformationPanel* infoPanel = new InformationPanel(infoDock);
     infoPanel->setCustomContextMenuActions({lockLayoutAction});
     connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
@@ -1274,6 +1773,29 @@ void DolphinMainWindow::setupDockWidgets()
             infoPanel, &InformationPanel::setSelection);
     connect(this, &DolphinMainWindow::requestItemInfo,
             infoPanel, &InformationPanel::requestDelayedItemInfo);
+    connect(this, &DolphinMainWindow::fileItemsChanged,
+            infoPanel, &InformationPanel::slotFilesItemChanged);
+#endif
+
+    // i18n: This is the last paragraph for the "What's This"-texts of all four panels.
+    const QString panelWhatsThis = xi18nc("@info:whatsthis", "<para>To show or "
+        "hide panels like this go to <interface>Control|Panels</interface> "
+        "or <interface>View|Panels</interface>.</para>");
+#ifdef HAVE_BALOO
+    actionCollection()->action(QStringLiteral("show_information_panel"))
+        ->setWhatsThis(xi18nc("@info:whatsthis", "<para> This toggles the "
+        "<emphasis>information</emphasis> panel at the right side of the "
+        "window.</para><para>The panel provides in-depth information "
+        "about the items your mouse is hovering over or about the selected "
+        "items. Otherwise it informs you about the currently viewed folder.<nl/>"
+        "For single items a preview of their contents is provided.</para>"));
+#endif
+    infoDock->setWhatsThis(xi18nc("@info:whatsthis", "<para>This panel "
+        "provides in-depth information about the items your mouse is "
+        "hovering over or about the selected items. Otherwise it informs "
+        "you about the currently viewed folder.<nl/>For single items a "
+        "preview of their contents is provided.</para><para>You can configure "
+        "which and how details are given here by right-clicking.</para>") + panelWhatsThis);
 
     // Setup "Folders"
     DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders"));
@@ -1297,8 +1819,19 @@ void DolphinMainWindow::setupDockWidgets()
     connect(foldersPanel, &FoldersPanel::errorMessage,
             this, &DolphinMainWindow::showErrorMessage);
 
+    actionCollection()->action(QStringLiteral("show_folders_panel"))
+        ->setWhatsThis(xi18nc("@info:whatsthis", "This toggles the "
+        "<emphasis>folders</emphasis> panel at the left side of the window."
+        "<nl/><nl/>It shows the folders of the <emphasis>file system"
+        "</emphasis> in a <emphasis>tree view</emphasis>."));
+    foldersDock->setWhatsThis(xi18nc("@info:whatsthis", "<para>This panel "
+        "shows the folders of the <emphasis>file system</emphasis> in a "
+        "<emphasis>tree view</emphasis>.</para><para>Click a folder to go "
+        "there. Click the arrow to the left of a folder to see its subfolders. "
+        "This allows quick switching between any folders.</para>") + panelWhatsThis);
+
     // Setup "Terminal"
-#ifndef Q_OS_WIN
+#ifdef HAVE_TERMINAL
     if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
         terminalDock->setLocked(lock);
@@ -1315,7 +1848,7 @@ void DolphinMainWindow::setupDockWidgets()
                 this, &DolphinMainWindow::slotTerminalPanelVisibilityChanged);
 
         QAction* terminalAction = terminalDock->toggleViewAction();
-        createPanelAction(QIcon::fromTheme(QStringLiteral("utilities-terminal")), Qt::Key_F4, terminalAction, QStringLiteral("show_terminal_panel"));
+        createPanelAction(QIcon::fromTheme(QStringLiteral("dialog-scripts")), Qt::Key_F4, terminalAction, QStringLiteral("show_terminal_panel"));
 
         addDockWidget(Qt::BottomDockWidgetArea, terminalDock);
         connect(this, &DolphinMainWindow::urlChanged,
@@ -1324,6 +1857,22 @@ void DolphinMainWindow::setupDockWidgets()
         if (GeneralSettings::version() < 200) {
             terminalDock->hide();
         }
+
+        actionCollection()->action(QStringLiteral("show_terminal_panel"))
+            ->setWhatsThis(xi18nc("@info:whatsthis", "<para>This toggles the "
+            "<emphasis>terminal</emphasis> panel at the bottom of the window."
+            "<nl/>The location in the terminal will always match the folder "
+            "view so you can navigate using either.</para><para>The terminal "
+            "panel is not needed for basic computer usage but can be useful "
+            "for advanced tasks. To learn more about terminals use the help "
+            "in a standalone terminal application like Konsole.</para>"));
+        terminalDock->setWhatsThis(xi18nc("@info:whatsthis", "<para>This is "
+            "the <emphasis>terminal</emphasis> panel. It behaves like a "
+            "normal terminal but will match the location of the folder view "
+            "so you can navigate using either.</para><para>The terminal panel "
+            "is not needed for basic computer usage but can be useful for "
+            "advanced tasks. To learn more about terminals use the help in a "
+            "standalone terminal application like Konsole.</para>") + panelWhatsThis);
     }
 #endif
 
@@ -1343,7 +1892,7 @@ void DolphinMainWindow::setupDockWidgets()
     placesDock->setWidget(m_placesPanel);
 
     QAction *placesAction = placesDock->toggleViewAction();
-    createPanelAction(QIcon::fromTheme(QStringLiteral("bookmarks")), Qt::Key_F9, placesAction, QStringLiteral("show_places_panel"));
+    createPanelAction(QIcon::fromTheme(QStringLiteral("compass")), Qt::Key_F9, placesAction, QStringLiteral("show_places_panel"));
 
     addDockWidget(Qt::LeftDockWidgetArea, placesDock);
     connect(m_placesPanel, &PlacesPanel::placeActivated,
@@ -1355,53 +1904,135 @@ void DolphinMainWindow::setupDockWidgets()
     connect(this, &DolphinMainWindow::urlChanged,
             m_placesPanel, &PlacesPanel::setUrl);
     connect(placesDock, &DolphinDockWidget::visibilityChanged,
-            m_tabWidget, &DolphinTabWidget::slotPlacesPanelVisibilityChanged);
+            &DolphinUrlNavigatorsController::slotPlacesPanelVisibilityChanged);
     connect(this, &DolphinMainWindow::settingsChanged,
         m_placesPanel, &PlacesPanel::readSettings);
     connect(m_placesPanel, &PlacesPanel::storageTearDownRequested,
             this, &DolphinMainWindow::slotStorageTearDownFromPlacesRequested);
     connect(m_placesPanel, &PlacesPanel::storageTearDownExternallyRequested,
             this, &DolphinMainWindow::slotStorageTearDownExternallyRequested);
-    m_tabWidget->slotPlacesPanelVisibilityChanged(m_placesPanel->isVisible());
+    DolphinUrlNavigatorsController::slotPlacesPanelVisibilityChanged(m_placesPanel->isVisible());
+
+    auto actionShowAllPlaces = new QAction(QIcon::fromTheme(QStringLiteral("view-hidden")), i18nc("@item:inmenu", "Show Hidden Places"), this);
+    actionShowAllPlaces->setCheckable(true);
+    actionShowAllPlaces->setDisabled(true);
+    actionShowAllPlaces->setWhatsThis(i18nc("@info:whatsthis", "This displays "
+        "all places in the places panel that have been hidden. They will "
+        "appear semi-transparent unless you uncheck their hide property."));
+
+    connect(actionShowAllPlaces, &QAction::triggered, this, [actionShowAllPlaces, this](bool checked){
+        actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
+        m_placesPanel->showHiddenEntries(checked);
+    });
+
+    connect(m_placesPanel, &PlacesPanel::showHiddenEntriesChanged, this, [actionShowAllPlaces] (bool checked){
+        actionShowAllPlaces->setChecked(checked);
+        actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
+   });
+
+    actionCollection()->action(QStringLiteral("show_places_panel"))
+        ->setWhatsThis(xi18nc("@info:whatsthis", "<para>This toggles the "
+        "<emphasis>places</emphasis> panel at the left side of the window."
+        "</para><para>It allows you to go to locations you have "
+        "bookmarked and to access disk or media attached to the computer "
+        "or to the network. It also contains sections to find recently "
+        "saved files or files of a certain type.</para>"));
+    placesDock->setWhatsThis(xi18nc("@info:whatsthis", "<para>This is the "
+        "<emphasis>Places</emphasis> panel. It allows you to go to locations "
+        "you have bookmarked and to access disk or media attached to the "
+        "computer or to the network. It also contains sections to find "
+        "recently saved files or files of a certain type.</para><para>"
+        "Click on an entry to go there. Click with the right mouse button "
+        "instead to open any entry in a new tab or new window.</para>"
+        "<para>New entries can be added by dragging folders onto this panel. "
+        "Right-click any section or entry to hide it. Right-click an empty "
+        "space on this panel and select <interface>Show Hidden Places"
+        "</interface> to display it again.</para>") + panelWhatsThis);
 
     // Add actions into the "Panels" menu
-    KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Panels"), this);
+    KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Show Panels"), this);
     actionCollection()->addAction(QStringLiteral("panels"), panelsMenu);
+    panelsMenu->setIcon(QIcon::fromTheme(QStringLiteral("view-sidetree")));
     panelsMenu->setDelayed(false);
     const KActionCollection* ac = actionCollection();
     panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel")));
+#ifdef HAVE_BALOO
     panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel")));
+#endif
     panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));
     panelsMenu->addAction(ac->action(QStringLiteral("show_terminal_panel")));
     panelsMenu->addSeparator();
+    panelsMenu->addAction(actionShowAllPlaces);
     panelsMenu->addAction(lockLayoutAction);
+
+    connect(panelsMenu->menu(), &QMenu::aboutToShow, this, [actionShowAllPlaces, this]{
+        actionShowAllPlaces->setEnabled(m_placesPanel->hiddenListCount());
+    });
 }
 
-void DolphinMainWindow::updateEditActions()
+
+void DolphinMainWindow::updateFileAndEditActions()
 {
     const KFileItemList list = m_activeViewContainer->view()->selectedItems();
+    const KActionCollection* col = actionCollection();
+    KFileItemListProperties capabilitiesSource(list);
+
+    QAction* addToPlacesAction = col->action(QStringLiteral("add_to_places"));
+    QAction* copyToOtherViewAction   = col->action(QStringLiteral("copy_to_inactive_split_view"));
+    QAction* moveToOtherViewAction   = col->action(QStringLiteral("move_to_inactive_split_view"));
+    QAction* copyLocation            = col->action(QString("copy_location"));
+
     if (list.isEmpty()) {
         stateChanged(QStringLiteral("has_no_selection"));
+
+        addToPlacesAction->setEnabled(true);
+        copyToOtherViewAction->setEnabled(false);
+        moveToOtherViewAction->setEnabled(false);
+        copyLocation->setEnabled(false);
     } else {
         stateChanged(QStringLiteral("has_selection"));
 
-        KActionCollection* col = actionCollection();
         QAction* renameAction            = col->action(KStandardAction::name(KStandardAction::RenameFile));
         QAction* moveToTrashAction       = col->action(KStandardAction::name(KStandardAction::MoveToTrash));
         QAction* deleteAction            = col->action(KStandardAction::name(KStandardAction::DeleteFile));
         QAction* cutAction               = col->action(KStandardAction::name(KStandardAction::Cut));
         QAction* deleteWithTrashShortcut = col->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler
         QAction* showTarget              = col->action(QStringLiteral("show_target"));
+        QAction* duplicateAction         = col->action(QStringLiteral("duplicate")); // see DolphinViewActionHandler
 
-        KFileItemListProperties capabilities(list);
-        const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving();
+        if (list.length() == 1 && list.first().isDir()) {
+            addToPlacesAction->setEnabled(true);
+        } else {
+            addToPlacesAction->setEnabled(false);
+        }
+
+        if (m_tabWidget->currentTabPage()->splitViewEnabled()) {
+            DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
+            KFileItem capabilitiesDestination;
+
+            if (tabPage->primaryViewActive()) {
+                capabilitiesDestination = tabPage->secondaryViewContainer()->url();
+            } else {
+                capabilitiesDestination = tabPage->primaryViewContainer()->url();
+            }
+
+            copyToOtherViewAction->setEnabled(capabilitiesDestination.isWritable());
+            moveToOtherViewAction->setEnabled(capabilitiesSource.supportsMoving() && capabilitiesDestination.isWritable());
+        } else {
+            copyToOtherViewAction->setEnabled(false);
+            moveToOtherViewAction->setEnabled(false);
+        }
+
+        const bool enableMoveToTrash = capabilitiesSource.isLocal() && capabilitiesSource.supportsMoving();
 
-        renameAction->setEnabled(capabilities.supportsMoving());
+        renameAction->setEnabled(capabilitiesSource.supportsMoving());
         moveToTrashAction->setEnabled(enableMoveToTrash);
-        deleteAction->setEnabled(capabilities.supportsDeleting());
-        deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash);
-        cutAction->setEnabled(capabilities.supportsMoving());
+        deleteAction->setEnabled(capabilitiesSource.supportsDeleting());
+        deleteWithTrashShortcut->setEnabled(capabilitiesSource.supportsDeleting() && !enableMoveToTrash);
+        cutAction->setEnabled(capabilitiesSource.supportsMoving());
+        copyLocation->setEnabled(list.length() == 1);
         showTarget->setEnabled(list.length() == 1 && list.at(0).isLink());
+        duplicateAction->setEnabled(capabilitiesSource.supportsWriting());
     }
 }
 
@@ -1409,81 +2040,29 @@ void DolphinMainWindow::updateViewActions()
 {
     m_actionHandler->updateViewActions();
 
-    QAction* showFilterBarAction = actionCollection()->action(QStringLiteral("show_filter_bar"));
-    showFilterBarAction->setChecked(m_activeViewContainer->isFilterBarVisible());
+    QAction* toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter"));
+    toggleFilterBarAction->setChecked(m_activeViewContainer->isFilterBarVisible());
 
     updateSplitAction();
-
-    QAction* editableLocactionAction = actionCollection()->action(QStringLiteral("editable_location"));
-    const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
-    editableLocactionAction->setChecked(urlNavigator->isUrlEditable());
 }
 
 void DolphinMainWindow::updateGoActions()
 {
     QAction* goUpAction = actionCollection()->action(KStandardAction::name(KStandardAction::Up));
     const QUrl currentUrl = m_activeViewContainer->url();
+    // I think this is one of the best places to firstly be confronted
+    // with a file system and its hierarchy. Talking about the root
+    // directory might seem too much here but it is the question that
+    // naturally arises in this context.
+    goUpAction->setWhatsThis(xi18nc("@info:whatsthis", "<para>Go to "
+        "the folder that contains the currently viewed one.</para>"
+        "<para>All files and folders are organized in a hierarchical "
+        "<emphasis>file system</emphasis>. At the top of this hierarchy is "
+        "a directory that contains all data connected to this computer"
+        "—the <emphasis>root directory</emphasis>.</para>"));
     goUpAction->setEnabled(KIO::upUrl(currentUrl) != currentUrl);
 }
 
-void DolphinMainWindow::createControlButton()
-{
-    if (m_controlButton) {
-        return;
-    }
-    Q_ASSERT(!m_controlButton);
-
-    m_controlButton = new QToolButton(this);
-    m_controlButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu")));
-    m_controlButton->setText(i18nc("@action", "Control"));
-    m_controlButton->setPopupMode(QToolButton::InstantPopup);
-    m_controlButton->setToolButtonStyle(toolBar()->toolButtonStyle());
-
-    QMenu* controlMenu = new QMenu(m_controlButton);
-    connect(controlMenu, &QMenu::aboutToShow, this, &DolphinMainWindow::updateControlMenu);
-
-    m_controlButton->setMenu(controlMenu);
-
-    toolBar()->addWidget(m_controlButton);
-    connect(toolBar(), &KToolBar::iconSizeChanged,
-            m_controlButton, &QToolButton::setIconSize);
-    connect(toolBar(), &KToolBar::toolButtonStyleChanged,
-            m_controlButton, &QToolButton::setToolButtonStyle);
-
-    // The added widgets are owned by the toolbar and may get deleted when e.g. the toolbar
-    // gets edited. In this case we must add them again. The adding is done asynchronously by
-    // m_updateToolBarTimer.
-    connect(m_controlButton, &QToolButton::destroyed, this, &DolphinMainWindow::slotControlButtonDeleted);
-    m_updateToolBarTimer = new QTimer(this);
-    m_updateToolBarTimer->setInterval(500);
-    connect(m_updateToolBarTimer, &QTimer::timeout, this, &DolphinMainWindow::updateToolBar);
-}
-
-void DolphinMainWindow::deleteControlButton()
-{
-    delete m_controlButton;
-    m_controlButton = nullptr;
-
-    delete m_updateToolBarTimer;
-    m_updateToolBarTimer = nullptr;
-}
-
-bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)
-{
-    Q_ASSERT(action);
-    Q_ASSERT(menu);
-
-    const KToolBar* toolBarWidget = toolBar();
-    foreach (const QWidget* widget, action->associatedWidgets()) {
-        if (widget == toolBarWidget) {
-            return false;
-        }
-    }
-
-    menu->addAction(action);
-    return true;
-}
-
 void DolphinMainWindow::refreshViews()
 {
     m_tabWidget->refreshViews();
@@ -1492,12 +2071,12 @@ void DolphinMainWindow::refreshViews()
         // The startup settings have been changed by the user (see bug #254947).
         // Synchronize the split-view setting with the active view:
         const bool splitView = GeneralSettings::splitView();
-        m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView);
+        m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView, WithAnimation);
         updateSplitAction();
-        setUrlAsCaption(activeViewContainer()->url());
+        updateWindowTitle();
     }
 
-    emit settingsChanged();
+    Q_EMIT settingsChanged();
 }
 
 void DolphinMainWindow::clearStatusBar()
@@ -1511,12 +2090,19 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
             this, &DolphinMainWindow::updateFilterBarAction);
     connect(container, &DolphinViewContainer::writeStateChanged,
             this, &DolphinMainWindow::slotWriteStateChanged);
+    connect(container, &DolphinViewContainer::searchModeEnabledChanged,
+            this, &DolphinMainWindow::updateSearchAction);
+
+    const QAction* toggleSearchAction = actionCollection()->action(QStringLiteral("toggle_search"));
+    connect(toggleSearchAction, &QAction::triggered, container, &DolphinViewContainer::setSearchModeEnabled);
 
     const DolphinView* view = container->view();
     connect(view, &DolphinView::selectionChanged,
             this, &DolphinMainWindow::slotSelectionChanged);
     connect(view, &DolphinView::requestItemInfo,
             this, &DolphinMainWindow::requestItemInfo);
+    connect(view, &DolphinView::fileItemsChanged,
+            this, &DolphinMainWindow::fileItemsChanged);
     connect(view, &DolphinView::tabRequested,
             this, &DolphinMainWindow::openNewTab);
     connect(view, &DolphinView::requestContextMenu,
@@ -1528,21 +2114,34 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
     connect(view, &DolphinView::directoryLoadingCompleted,
             this, &DolphinMainWindow::slotDirectoryLoadingCompleted);
     connect(view, &DolphinView::goBackRequested,
-            this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goBack));
+            this, &DolphinMainWindow::goBack);
     connect(view, &DolphinView::goForwardRequested,
-            this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goForward));
+            this, &DolphinMainWindow::goForward);
     connect(view, &DolphinView::urlActivated,
             this, &DolphinMainWindow::handleUrl);
+    connect(view, &DolphinView::goUpRequested,
+            this, &DolphinMainWindow::goUp);
+
+    auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
+        (actionCollection()->action(QStringLiteral("url_navigators")));
+
+    const KUrlNavigator *navigator = m_tabWidget->currentTabPage()->primaryViewActive() ?
+                                     navigators->primaryUrlNavigator() :
+                                     navigators->secondaryUrlNavigator();
 
-    const KUrlNavigator* navigator = container->urlNavigator();
     connect(navigator, &KUrlNavigator::urlChanged,
             this, &DolphinMainWindow::changeUrl);
-    connect(navigator, &KUrlNavigator::historyChanged,
-            this, &DolphinMainWindow::updateHistory);
+    QAction *editableLocactionAction = actionCollection()->action(QStringLiteral("editable_location"));
+    editableLocactionAction->setChecked(navigator->isUrlEditable());
     connect(navigator, &KUrlNavigator::editableStateChanged,
             this, &DolphinMainWindow::slotEditableStateChanged);
     connect(navigator, &KUrlNavigator::tabRequested,
             this, &DolphinMainWindow::openNewTab);
+
+    disconnect(m_updateHistoryConnection);
+    m_updateHistoryConnection = connect(
+            container->urlNavigatorInternalWithHistory(), &KUrlNavigator::historyChanged,
+            this, &DolphinMainWindow::updateHistory);
 }
 
 void DolphinMainWindow::updateSplitAction()
@@ -1550,7 +2149,7 @@ void DolphinMainWindow::updateSplitAction()
     QAction* splitAction = actionCollection()->action(QStringLiteral("split_view"));
     const DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
     if (tabPage->splitViewEnabled()) {
-        if (tabPage->primaryViewActive()) {
+        if (GeneralSettings::closeActiveSplitView() ? tabPage->primaryViewActive() : !tabPage->primaryViewActive()) {
             splitAction->setText(i18nc("@action:intoolbar Close left view", "Close"));
             splitAction->setToolTip(i18nc("@info", "Close left view"));
             splitAction->setIcon(QIcon::fromTheme(QStringLiteral("view-left-close")));
@@ -1566,6 +2165,21 @@ void DolphinMainWindow::updateSplitAction()
     }
 }
 
+void DolphinMainWindow::updateAllowedToolbarAreas()
+{
+    auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
+                        (actionCollection()->action(QStringLiteral("url_navigators")));
+    if (toolBar()->actions().contains(navigators)) {
+        toolBar()->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
+        if (toolBarArea(toolBar()) == Qt::LeftToolBarArea ||
+            toolBarArea(toolBar()) == Qt::RightToolBarArea) {
+            addToolBar(Qt::TopToolBarArea, toolBar());
+        }
+    } else {
+        toolBar()->setAllowedAreas(Qt::AllToolBarAreas);
+    }
+}
+
 bool DolphinMainWindow::isKompareInstalled() const
 {
     static bool initialized = false;
@@ -1595,6 +2209,244 @@ void DolphinMainWindow::createPanelAction(const QIcon& icon,
     connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked);
 }
 
+void DolphinMainWindow::setupWhatsThis()
+{
+    // main widgets
+    menuBar()->setWhatsThis(xi18nc("@info:whatsthis", "<para>This is the "
+        "<emphasis>Menubar</emphasis>. It provides access to commands and "
+        "configuration options. Left-click on any of the menus on this "
+        "bar to see its contents.</para><para>The Menubar can be hidden "
+        "by unchecking <interface>Settings|Show Menubar</interface>. Then "
+        "most of its contents become available through a <interface>Control"
+        "</interface> button on the <emphasis>Toolbar</emphasis>.</para>"));
+    toolBar()->setWhatsThis(xi18nc("@info:whatsthis", "<para>This is the "
+        "<emphasis>Toolbar</emphasis>. It allows quick access to "
+        "frequently used actions.</para><para>It is highly customizable. "
+        "All items you see in the <interface>Control</interface> menu or "
+        "in the <interface>Menubar</interface> can be placed on the "
+        "Toolbar. Just right-click on it and select <interface>Configure "
+        "Toolbars…</interface> or find this action in the <interface>"
+        "Control</interface> or <interface>Settings</interface> menu."
+        "</para><para>The location of the bar and the style of its "
+        "buttons can also be changed in the right-click menu. Right-click "
+        "a button if you want to show or hide its text.</para>"));
+    m_tabWidget->setWhatsThis(xi18nc("@info:whatsthis main view",
+        "<para>Here you can see the <emphasis>folders</emphasis> and "
+        "<emphasis>files</emphasis> that are at the location described in "
+        "the <interface>Location Bar</interface> above. This area is the "
+        "central part of this application where you navigate to the files "
+        "you want to use.</para><para>For an elaborate and general "
+        "introduction to this application <link "
+        "url='https://userbase.kde.org/Dolphin/File_Management#Introduction_to_Dolphin'>"
+        "click here</link>. This will open an introductory article from "
+        "the <emphasis>KDE UserBase Wiki</emphasis>.</para><para>For brief "
+        "explanations of all the features of this <emphasis>view</emphasis> "
+        "<link url='help:/dolphin/dolphin-view.html'>click here</link> "
+        "instead. This will open a page from the <emphasis>Handbook"
+        "</emphasis> that covers the basics.</para>"));
+
+    // Settings menu
+    actionCollection()->action(KStandardAction::name(KStandardAction::KeyBindings))
+        ->setWhatsThis(xi18nc("@info:whatsthis","<para>This opens a window "
+        "that lists the <emphasis>keyboard shortcuts</emphasis>.<nl/>"
+        "There you can set up key combinations to trigger an action when "
+        "they are pressed simultaneously. All commands in this application can "
+        "be triggered this way.</para>"));
+    actionCollection()->action(KStandardAction::name(KStandardAction::ConfigureToolbars))
+        ->setWhatsThis(xi18nc("@info:whatsthis","<para>This opens a window in which "
+        "you can change which buttons appear on the <emphasis>Toolbar</emphasis>.</para>"
+        "<para>All items you see in the <interface>Control</interface> menu "
+        "or in the <interface>Menubar</interface> can also be placed on the Toolbar.</para>"));
+    actionCollection()->action(KStandardAction::name(KStandardAction::Preferences))
+        ->setWhatsThis(xi18nc("@info:whatsthis","This opens a window where you can "
+        "change a multitude of settings for this application. For an explanation "
+        "of the various settings go to the chapter <emphasis>Configuring Dolphin"
+        "</emphasis> in <interface>Help|Dolphin Handbook</interface>."));
+
+    // Help menu
+    // The whatsthis has to be set for the m_helpMenu and for the
+    // StandardAction separately because both are used in different locations.
+    // m_helpMenu is only used for createControlButton() button.
+
+    // Links do not work within the Menubar so texts without links are provided there.
+
+    // i18n: If the external link isn't available in your language you should
+    // probably state the external link language at least in brackets to not
+    // frustrate the user. If there are multiple languages that the user might
+    // know with a reasonable chance you might want to have 2 external links.
+    // The same is in my opinion true for every external link you translate.
+    const QString whatsThisHelpContents = xi18nc("@info:whatsthis handbook",
+        "<para>This opens the Handbook for this application. It provides "
+        "explanations for every part of <emphasis>Dolphin</emphasis>.</para>");
+    actionCollection()->action(KStandardAction::name(KStandardAction::HelpContents))
+        ->setWhatsThis(whatsThisHelpContents
+        + xi18nc("@info:whatsthis second half of handbook hb text without link",
+        "<para>If you want more elaborate introductions to the "
+        "different features of <emphasis>Dolphin</emphasis> "
+        "go to the KDE UserBase Wiki.</para>"));
+    m_helpMenu->action(KHelpMenu::menuHelpContents)->setWhatsThis(whatsThisHelpContents
+        + xi18nc("@info:whatsthis second half of handbook text with link",
+        "<para>If you want more elaborate introductions to the "
+        "different features of <emphasis>Dolphin</emphasis> "
+        "<link url='https://userbase.kde.org/Dolphin/File_Management'>click here</link>. "
+        "It will open the dedicated page in the KDE UserBase Wiki.</para>"));
+
+    const QString whatsThisWhatsThis = xi18nc("@info:whatsthis whatsthis button",
+        "<para>This is the button that invokes the help feature you are "
+        "using right now! Click it, then click any component of this "
+        "application to ask \"What's this?\" about it. The mouse cursor "
+        "will change appearance if no help is available for a spot.</para>");
+    actionCollection()->action(KStandardAction::name(KStandardAction::WhatsThis))
+       ->setWhatsThis(whatsThisWhatsThis
+        + xi18nc("@info:whatsthis second half of whatsthis button text without link",
+        "<para>There are two other ways to get help for this application: The "
+        "<interface>Dolphin Handbook</interface> in the <interface>Help"
+        "</interface> menu and the <emphasis>KDE UserBase Wiki</emphasis> "
+        "article about <emphasis>File Management</emphasis> online."
+        "</para><para>The \"What's this?\" help is "
+        "missing in most other windows so don't get too used to this.</para>"));
+    m_helpMenu->action(KHelpMenu::menuWhatsThis)->setWhatsThis(whatsThisWhatsThis
+        + xi18nc("@info:whatsthis second half of whatsthis button text with link",
+        "<para>There are two other ways to get help: "
+        "The <link url='help:/dolphin/index.html'>Dolphin Handbook</link> and "
+        "the <link url='https://userbase.kde.org/Dolphin/File_Management'>KDE "
+        "UserBase Wiki</link>.</para><para>The \"What's this?\" help is "
+        "missing in most other windows so don't get too used to this.</para>"));
+
+    const QString whatsThisReportBug = xi18nc("@info:whatsthis","<para>This opens a "
+        "window that will guide you through reporting errors or flaws "
+        "in this application or in other KDE software.</para>");
+    actionCollection()->action(KStandardAction::name(KStandardAction::ReportBug))
+       ->setWhatsThis(whatsThisReportBug);
+    m_helpMenu->action(KHelpMenu::menuReportBug)->setWhatsThis(whatsThisReportBug
+        + xi18nc("@info:whatsthis second half of reportbug text with link",
+        "<para>High-quality bug reports are much appreciated. To learn "
+        "how to make your bug report as effective as possible "
+        "<link url='https://community.kde.org/Get_Involved/Bug_Reporting'>"
+        "click here</link>.</para>"));
+
+    const QString whatsThisDonate = xi18nc("@info:whatsthis","<para>This opens a "
+        "<emphasis>web page</emphasis> where you can donate to "
+        "support the continued work on this application and many "
+        "other projects by the <emphasis>KDE</emphasis> community.</para>"
+        "<para>Donating is the easiest and fastest way to efficiently "
+        "support KDE and its projects. KDE projects are available for "
+        "free therefore your donation is needed to cover things that "
+        "require money like servers, contributor meetings, etc.</para>"
+        "<para><emphasis>KDE e.V.</emphasis> is the non-profit "
+        "organization behind the KDE community.</para>");
+    actionCollection()->action(KStandardAction::name(KStandardAction::Donate))
+       ->setWhatsThis(whatsThisDonate);
+    m_helpMenu->action(KHelpMenu::menuDonate)->setWhatsThis(whatsThisDonate);
+
+    const QString whatsThisSwitchLanguage = xi18nc("@info:whatsthis",
+        "With this you can change the language this application uses."
+        "<nl/>You can even set secondary languages which will be used "
+        "if texts are not available in your preferred language.");
+    actionCollection()->action(KStandardAction::name(KStandardAction::SwitchApplicationLanguage))
+       ->setWhatsThis(whatsThisSwitchLanguage);
+    m_helpMenu->action(KHelpMenu::menuSwitchLanguage)->setWhatsThis(whatsThisSwitchLanguage);
+
+    const QString whatsThisAboutApp = xi18nc("@info:whatsthis","This opens a "
+        "window that informs you about the version, license, "
+        "used libraries and maintainers of this application.");
+    actionCollection()->action(KStandardAction::name(KStandardAction::AboutApp))
+       ->setWhatsThis(whatsThisAboutApp);
+    m_helpMenu->action(KHelpMenu::menuAboutApp)->setWhatsThis(whatsThisAboutApp);
+
+    const QString whatsThisAboutKDE = xi18nc("@info:whatsthis","This opens a "
+        "window with information about <emphasis>KDE</emphasis>. "
+        "The KDE community are the people behind this free software."
+        "<nl/>If you like using this application but don't know "
+        "about KDE or want to see a cute dragon have a look!");
+    actionCollection()->action(KStandardAction::name(KStandardAction::AboutKDE))
+       ->setWhatsThis(whatsThisAboutKDE);
+    m_helpMenu->action(KHelpMenu::menuAboutKDE)->setWhatsThis(whatsThisAboutKDE);
+}
+
+bool DolphinMainWindow::addHamburgerMenuToToolbar()
+{
+    QDomDocument domDocument = KXMLGUIClient::domDocument();
+    if (domDocument.isNull()) {
+        return false;
+    }
+    QDomNode toolbar = domDocument.elementsByTagName(QStringLiteral("ToolBar")).at(0);
+    if (toolbar.isNull()) {
+        return false;
+    }
+
+    QDomElement hamburgerMenuElement = domDocument.createElement(QStringLiteral("Action"));
+    hamburgerMenuElement.setAttribute(QStringLiteral("name"), QStringLiteral("hamburger_menu"));
+    toolbar.appendChild(hamburgerMenuElement);
+
+    KXMLGUIFactory::saveConfigFile(domDocument, xmlFile());
+    reloadXML();
+    createGUI();
+    return true;
+    // Make sure to also remove the <KXMLGUIFactory> and <QDomDocument> include
+    // whenever this method is removed (maybe in the year ~2026).
+}
+
+bool DolphinMainWindow::event(QEvent *event)
+{
+    if (event->type() == QEvent::WhatsThisClicked) {
+        event->accept();
+        QWhatsThisClickedEvent* whatsThisEvent = dynamic_cast<QWhatsThisClickedEvent*>(event);
+        QDesktopServices::openUrl(QUrl(whatsThisEvent->href()));
+        return true;
+    }
+    return KXmlGuiWindow::event(event);
+}
+
+bool DolphinMainWindow::eventFilter(QObject* obj, QEvent* event)
+{
+    Q_UNUSED(obj)
+    if (event->type() == QEvent::WhatsThisClicked) {
+        event->accept();
+        QWhatsThisClickedEvent* whatsThisEvent = dynamic_cast<QWhatsThisClickedEvent*>(event);
+        QDesktopServices::openUrl(QUrl(whatsThisEvent->href()));
+        return true;
+    }
+    return false;
+}
+
+// Set a sane initial window size
+QSize DolphinMainWindow::sizeHint() const
+{
+    return KXmlGuiWindow::sizeHint().expandedTo(QSize(760, 550));
+}
+
+void DolphinMainWindow::saveNewToolbarConfig()
+{
+    KXmlGuiWindow::saveNewToolbarConfig(); // Applies the new config. This has to be called first
+                                           // because the rest of this method decides things
+                                           // based on the new config.
+    auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
+                        (actionCollection()->action(QStringLiteral("url_navigators")));
+    if (!toolBar()->actions().contains(navigators)) {
+        m_tabWidget->currentTabPage()->insertNavigatorsWidget(navigators);
+    }
+    updateAllowedToolbarAreas();
+    (static_cast<KHamburgerMenu *>(actionCollection()->action(KStandardAction::name(
+                            KStandardAction::HamburgerMenu))))->hideActionsOf(toolBar());
+}
+
+void DolphinMainWindow::focusTerminalPanel()
+{
+    if (m_terminalPanel->isVisible()) {
+        if (m_terminalPanel->terminalHasFocus()) {
+            m_activeViewContainer->view()->setFocus(Qt::FocusReason::ShortcutFocusReason);
+            actionCollection()->action(QStringLiteral("focus_terminal_panel"))->setText(i18nc("@action:inmenu Tools", "Focus Terminal Panel"));
+        } else {
+            m_terminalPanel->setFocus(Qt::FocusReason::ShortcutFocusReason);
+            actionCollection()->action(QStringLiteral("focus_terminal_panel"))->setText(i18nc("@action:inmenu Tools", "Defocus Terminal Panel"));
+        }
+    } else {
+        actionCollection()->action(QStringLiteral("show_terminal_panel"))->trigger();
+        actionCollection()->action(QStringLiteral("focus_terminal_panel"))->setText(i18nc("@action:inmenu Tools", "Defocus Terminal Panel"));
+    }
+}
+
 DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
     KIO::FileUndoManager::UiInterface()
 {
@@ -1615,3 +2467,8 @@ void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
     }
 }
 
+bool DolphinMainWindow::isUrlOpen(const QString& url)
+{
+    return m_tabWidget->isUrlOpen(QUrl::fromUserInput((url)));
+}
+