+}
+// clang-format off
+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>Menu"
+ "</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>Menu</interface> 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 within the <interface>"
+ "menu</interface>."
+ "</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>Menu</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
+
+ auto setStandardActionWhatsThis = [this](KStandardAction::StandardAction actionId,
+ const QString &whatsThis) {
+ // Check for the existence of an action since it can be restricted through the Kiosk system
+ if (auto *action = actionCollection()->action(KStandardAction::name(actionId))) {
+ action->setWhatsThis(whatsThis);
+ }
+ };
+
+ // i18n: If the external link isn't available in your language it might make
+ // sense to state the external link's language 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 might be true for any external link you translate.
+ setStandardActionWhatsThis(KStandardAction::HelpContents, xi18nc("@info:whatsthis handbook", "<para>This opens the Handbook for this application. It provides explanations for every part of <emphasis>Dolphin</emphasis>.</para><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>"));
+ // (The i18n call should be completely in the line following the i18n: comment without any line breaks within the i18n call or the comment might not be correctly extracted. See: https://commits.kde.org/kxmlgui/a31135046e1b3335b5d7bbbe6aa9a883ce3284c1 )
+
+ setStandardActionWhatsThis(KStandardAction::WhatsThis,
+ 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>"
+ "<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>"));
+
+ setStandardActionWhatsThis(KStandardAction::ReportBug,
+ 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>"
+ "<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>"));
+
+ setStandardActionWhatsThis(KStandardAction::Donate,
+ 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>"));
+
+ setStandardActionWhatsThis(KStandardAction::SwitchApplicationLanguage,
+ 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."));
+
+ setStandardActionWhatsThis(KStandardAction::AboutApp,
+ xi18nc("@info:whatsthis","This opens a "
+ "window that informs you about the version, license, "
+ "used libraries and maintainers of this application."));
+
+ setStandardActionWhatsThis(KStandardAction::AboutKDE,
+ 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!"));
+}
+// clang-format on
+
+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).
+}
+
+// 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();
+ updateNavigatorsBackground();
+ (static_cast<KHamburgerMenu *>(actionCollection()->action(KStandardAction::name(KStandardAction::HamburgerMenu))))->hideActionsOf(toolBar());
+}
+
+void DolphinMainWindow::toggleTerminalPanelFocus()
+{
+ if (!m_terminalPanel->isVisible()) {
+ actionCollection()->action(QStringLiteral("show_terminal_panel"))->trigger(); // Also moves focus to the panel.
+ actionCollection()->action(QStringLiteral("focus_terminal_panel"))->setText(i18nc("@action:inmenu Tools", "Defocus Terminal Panel"));
+ return;
+ }
+
+ 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"));
+ return;
+ }
+
+ m_terminalPanel->setFocus(Qt::FocusReason::ShortcutFocusReason);
+ actionCollection()->action(QStringLiteral("focus_terminal_panel"))->setText(i18nc("@action:inmenu Tools", "Defocus Terminal Panel"));
+}
+
+void DolphinMainWindow::togglePlacesPanelFocus()
+{
+ if (!m_placesPanel->isVisible()) {
+ actionCollection()->action(QStringLiteral("show_places_panel"))->trigger(); // Also moves focus to the panel.
+ actionCollection()->action(QStringLiteral("focus_places_panel"))->setText(i18nc("@action:inmenu View", "Defocus Terminal Panel"));
+ return;
+ }