diff options
| author | Saravanan K <[email protected]> | 2021-05-20 16:04:41 +0000 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2021-05-20 16:04:41 +0000 |
| commit | 6b64c7ff56e0025608d03f21e64f47431e23ef23 (patch) | |
| tree | 7f1e1468888716331ff0287d66dcb49805fe1b5d /src/panels | |
| parent | 2e536476dd81a241b901b4d1083f0f429561d28b (diff) | |
Add action to places panel context menu trash entry to open trash settings
BUG: 367583
FIXED-IN: 21.08
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index d49ad39ec..1f5f0260f 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -23,6 +23,7 @@ #include "placesview.h" #include "trash/dolphintrash.h" #include "views/draganddrophelper.h" +#include "settings/dolphinsettingsdialog.h" #include <KFilePlaceEditDialog> #include <KFilePlacesModel> @@ -181,6 +182,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) QMenu menu(this); QAction* emptyTrashAction = nullptr; + QAction* configureTrashAction = nullptr; QAction* editAction = nullptr; QAction* teardownAction = nullptr; QAction* ejectAction = nullptr; @@ -200,7 +202,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) if (item->url().isLocalFile()) { propertiesAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action:inmenu", "Properties")); } - if (!isDevice && !isTrash) { + if (!isDevice) { menu.addSeparator(); } @@ -236,6 +238,10 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) } } + if (isTrash) { + configureTrashAction = menu.addAction(QIcon::fromTheme(QStringLiteral("configure")), i18nc("@action:inmenu", "Configure Trash...")); + } + if (!isDevice) { editAction = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-entry")), i18nc("@item:inmenu", "Edit...")); } @@ -255,6 +261,11 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) if (action) { if (action == emptyTrashAction) { Trash::empty(this); + } else if (action == configureTrashAction) { + DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(item->url(), this); + settingsDialog->setCurrentPage(settingsDialog->trashSettings); + settingsDialog->setAttribute(Qt::WA_DeleteOnClose); + settingsDialog->show(); } else { // The index might have changed if devices were added/removed while // the context menu was open. |
