+ if (actionTextHelper) {
+ // The "…" at the end make clear that they won't trigger their respective actions directly.
+ actionTextHelper->registerTextWhenNothingIsSelected(trashAction, i18nc("@action:inmenu File", "Move to Trash…"));
+ actionTextHelper->registerTextWhenNothingIsSelected(deleteAction, i18nc("@action:inmenu File", "Delete…"));
+ actionTextHelper->registerTextWhenNothingIsSelected(duplicateAction, i18nc("@action:inmenu File", "Duplicate Here…"));
+ actionTextHelper->registerTextWhenNothingIsSelected(copyPathAction, i18nc("@action:incontextmenu", "Copy Location…"));
+ }
+
+ // This menu makes sure that users who don't know how to open a context menu and haven't
+ // figured out how to enable the menu bar can still perform basic file manipulation.
+ // This only works if they know how to select a file.
+ // The text when nothing is selected at least implies that a selection can /somehow/ be made.
+ // This menu is by default only used in the hamburger menu but created here so users can put
+ // it on their toolbar.
+ KActionMenu *basicActionsMenu = m_actionCollection->add<KActionMenu>(QStringLiteral("basic_actions"), this);
+ // The text is set later depending on the selection in the currently active view.
+ basicActionsMenu->setPopupMode(QToolButton::InstantPopup);
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::Cut)));
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::Copy)));
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::Paste)));
+ basicActionsMenu->addSeparator();
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::RenameFile)));
+ basicActionsMenu->addAction(m_actionCollection->action(KStandardAction::name(KStandardAction::MoveToTrash)));
+ basicActionsMenu->addSeparator();
+ basicActionsMenu->addAction(m_actionCollection->action(QStringLiteral("properties")));
+ basicActionsMenu->addSeparator(); // We add one more separator because we sometimes add contextual
+ // actions in slotSelectionChanged() after the static ones above.
+
+ // View menu
+ KToggleAction *iconsAction = iconsModeAction();
+ KToggleAction *compactAction = compactModeAction();
+ KToggleAction *detailsAction = detailsModeAction();
+
+ iconsAction->setWhatsThis(xi18nc("@info:whatsthis Icons view mode",
+ "<para>This switches to a view mode that focuses on the folder "
+ "and file icons. This mode makes it easy to distinguish folders "
+ "from files and to detect items with distinctive <emphasis>"
+ "file types</emphasis>.</para><para> This mode is handy to "
+ "browse through pictures when the <interface>Preview"
+ "</interface> option is enabled.</para>"));
+ compactAction->setWhatsThis(xi18nc("@info:whatsthis Compact view mode",
+ "<para>This switches to a compact view mode that lists the folders "
+ "and files in columns with the names beside the icons.</para><para>"
+ "This helps to give you an overview in folders with many items.</para>"));
+ detailsAction->setWhatsThis(xi18nc("@info:whatsthis Details view mode",
+ "<para>This switches to a list view mode that focuses on folder "
+ "and file details.</para><para>Click on a detail in the column "
+ "header to sort the items by it. Click again to sort the other "
+ "way around. To select which details should be displayed click "
+ "the header with the right mouse button.</para><para>You can "
+ "view the contents of a folder without leaving the current "
+ "location by clicking the region to the left of it. This way you can "
+ "view the contents of multiple folders in the same list.</para>"));
+
+ KSelectAction *viewModeActions = m_actionCollection->add<KSelectAction>(QStringLiteral("view_mode"));
+ viewModeActions->setText(i18nc("@action:intoolbar", "Change View Mode"));
+ viewModeActions->setWhatsThis(xi18nc("@info:whatsthis View Mode Toolbutton", "This cycles through all view modes."));