From 3f41cd9c0060e9a8dda919ec3f5b82f6d7a8ee74 Mon Sep 17 00:00:00 2001 From: Thomas Surrel Date: Wed, 3 Oct 2018 22:20:37 +0200 Subject: [PATCH] Add a 'Properties' entry in the Places panel context menu Summary: BUG: 181880 Test Plan: Right-click on a place or on a device in the Places panel now show a Properties entry. Clicking on it will open its folder property. Reviewers: #dolphin, #plasma, #vdg, ngraham, elvisangelaccio Reviewed By: #dolphin, #vdg, ngraham, elvisangelaccio Subscribers: anthonyfieroni, elvisangelaccio, cfeck, ngraham, abetts, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D15929 --- src/panels/places/placespanel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 8a8fa8a7d..7b4900f7c 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -214,6 +215,10 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) QAction* openInNewWindowAction = menu.addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("@item:inmenu", "Open in New Window")); QAction* openInNewTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@item:inmenu", "Open in New Tab")); + QAction* propertiesAction = nullptr; + if (item->url().isLocalFile()) { + propertiesAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action:inmenu", "Properties")); + } if (!isDevice && !isTrash) { menu.addSeparator(); } @@ -265,6 +270,10 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) m_model->requestTearDown(index); } else if (action == ejectAction) { m_model->requestEject(index); + } else if (action == propertiesAction) { + KPropertiesDialog* dialog = new KPropertiesDialog(item->url(), this); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->show(); } } } -- 2.47.3