X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/36dfe5795f3e70ad9ac4954544899bf38c919ca7..ef4525e53568385053a638311f6ad751d42f2f4c:/src/views/dolphinviewactionhandler.cpp diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 32bec03df..2934e8005 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -60,6 +60,7 @@ void DolphinViewActionHandler::setCurrentView(DolphinView *view) connect(view, &DolphinView::sortRoleChanged, this, &DolphinViewActionHandler::slotSortRoleChanged); connect(view, &DolphinView::zoomLevelChanged, this, &DolphinViewActionHandler::slotZoomLevelChanged); connect(view, &DolphinView::writeStateChanged, this, &DolphinViewActionHandler::slotWriteStateChanged); + slotWriteStateChanged(view->isFolderWritable()); connect(view, &DolphinView::selectionModeChangeRequested, this, [this](bool enabled) { Q_EMIT selectionModeChangeTriggered(enabled); }); @@ -77,7 +78,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac // This action doesn't appear in the GUI, it's for the shortcut only. // KNewFileMenu takes care of the GUI stuff. QAction *newDirAction = m_actionCollection->addAction(QStringLiteral("create_dir")); - newDirAction->setText(i18nc("@action", "Create Folder...")); + newDirAction->setText(i18nc("@action", "Create Folder…")); m_actionCollection->setDefaultShortcuts(newDirAction, KStandardShortcut::createFolder()); newDirAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new"))); newDirAction->setEnabled(false); // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable @@ -89,7 +90,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac renameAction->setWhatsThis(xi18nc("@info:whatsthis", "This renames the " "items in your current selection.Renaming multiple items " - "at once amounts to their new names differing only in a number.")); + "at once results in their new names differing only in a number.")); auto trashAction = KStandardAction::moveToTrash(this, &DolphinViewActionHandler::slotTrashActivated, m_actionCollection); auto trashShortcuts = trashAction->shortcuts(); @@ -101,8 +102,8 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac trashAction->setWhatsThis(xi18nc("@info:whatsthis", "This moves the " "items in your current selection to the Trash" - ".The trash is a temporary storage where " - "items can be deleted from if disk space is needed.")); + ".The trash is a temporary storage location where " + "items can be deleted later if disk space is needed.")); auto deleteAction = KStandardAction::deleteFile(this, &DolphinViewActionHandler::slotDeleteItems, m_actionCollection); auto deleteShortcuts = deleteAction->shortcuts(); @@ -113,8 +114,8 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac } deleteAction->setWhatsThis(xi18nc("@info:whatsthis", "This deletes " - "the items in your current selection completely. They can " - "not be recovered by normal means.")); + "the items in your current selection permanently. They " + "cannot be recovered by normal means.")); // This action is useful for being enabled when KStandardAction::MoveToTrash should be // disabled and KStandardAction::DeleteFile is enabled (e.g. non-local files), so that Key_Del @@ -198,7 +199,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac compactAction->setWhatsThis(xi18nc("@info:whatsthis Compact view mode", "This switches to a compact view mode that lists the folders " "and files in columns with the names beside the icons." - "This helps to keep the overview in folders with many items.")); + "This helps to give you an overview in folders with many items.")); detailsAction->setWhatsThis(xi18nc("@info:whatsthis Details view mode", "This switches to a list view mode that focuses on folder " "and file details.Click on a detail in the column " @@ -206,8 +207,8 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac "way around. To select which details should be displayed click " "the header with the right mouse button.You can " "view the contents of a folder without leaving the current " - "location by clicking to the left of it. This way you can view " - "the contents of multiple folders in the same list.")); + "location by clicking the region to the left of it. This way you can " + "view the contents of multiple folders in the same list.")); KSelectAction *viewModeActions = m_actionCollection->add(QStringLiteral("view_mode")); viewModeActions->setText(i18nc("@action:intoolbar", "View Mode")); @@ -215,7 +216,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac viewModeActions->addAction(compactAction); viewModeActions->addAction(detailsAction); viewModeActions->setToolBarMode(KSelectAction::MenuMode); - connect(viewModeActions, &KSelectAction::triggered, this, &DolphinViewActionHandler::slotViewModeActionTriggered); + connect(viewModeActions, &KSelectAction::actionTriggered, this, &DolphinViewActionHandler::slotViewModeActionTriggered); QAction *zoomInAction = KStandardAction::zoomIn(this, &DolphinViewActionHandler::zoomIn, m_actionCollection); zoomInAction->setWhatsThis(i18nc("@info:whatsthis zoom in", "This increases the icon size.")); @@ -248,6 +249,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac "contents.For example the icons of images become scaled " "down versions of the images.")); showPreview->setIcon(QIcon::fromTheme(QStringLiteral("view-preview"))); + m_actionCollection->setDefaultShortcut(showPreview, QKeySequence(Qt::Key_F12)); connect(showPreview, &KToggleAction::triggered, this, &DolphinViewActionHandler::togglePreview); KToggleAction *sortFoldersFirst = m_actionCollection->add(QStringLiteral("folders_first")); @@ -318,16 +320,20 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files")); showHiddenFiles->setWhatsThis(xi18nc("@info:whatsthis", "When " - "this is enabled hidden files and folders " + "this is enabled, hidden files and folders " "are visible. They will be displayed semi-transparent." - "Hidden items only differ from other ones in that their " - "name starts with a \".\". In general there is no need for " - "users to access them which is why they are hidden.")); + "Hidden items only differ from normal ones in that their " + "name starts with a dot (\".\"). Typically, there is no need for " + "users to access them, which is why they are hidden." + "Items can also be hidden if their names are listed in a text file " + "named \".hidden\". Files with the \"application/x-trash\" MIME type, " + "such as backup files, can also be hidden by enabling that setting in " + "Configure Dolphin > View > General.")); m_actionCollection->setDefaultShortcuts(showHiddenFiles, KStandardShortcut::showHideHiddenFiles()); connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles); QAction *adjustViewProps = m_actionCollection->addAction(QStringLiteral("view_properties")); - adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Display Style...")); + adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Display Style…")); adjustViewProps->setIcon(QIcon::fromTheme(QStringLiteral("view-choose"))); adjustViewProps->setWhatsThis(i18nc("@info:whatsthis", "This opens a window " @@ -714,7 +720,7 @@ void DolphinViewActionHandler::slotSortTriggered(QAction *action) // actions and the sub-menu-actions. If an action gets checked, it must // be assured that all other actions get unchecked, except the ascending/ // descending actions - for (QAction *groupAction : qAsConst(m_sortByActions)) { + for (QAction *groupAction : std::as_const(m_sortByActions)) { KActionMenu *actionMenu = qobject_cast(groupAction); if (actionMenu) { const auto actions = actionMenu->menu()->actions(); @@ -820,3 +826,5 @@ void DolphinViewActionHandler::slotSelectionChanged(const KFileItemList &selecti } } } + +#include "moc_dolphinviewactionhandler.cpp"