┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/places/placespanel.cpp
diff options
context:
space:
mode:
authorThomas Surrel <[email protected]>2018-10-03 22:20:37 +0200
committerThomas Surrel <[email protected]>2018-10-14 12:23:25 +0200
commit3f41cd9c0060e9a8dda919ec3f5b82f6d7a8ee74 (patch)
tree8302efd8ba4c3b24f11b2882e3412f00b4521a46 /src/panels/places/placespanel.cpp
parentec3cf251b188cc1d52d65829a9fb7123571b01b0 (diff)
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
Diffstat (limited to 'src/panels/places/placespanel.cpp')
-rw-r--r--src/panels/places/placespanel.cpp9
1 files changed, 9 insertions, 0 deletions
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 <KIconLoader>
#include <KLocalizedString>
#include <KMountPoint>
+#include <KPropertiesDialog>
#include <QGraphicsSceneDragDropEvent>
#include <QIcon>
@@ -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();
}
}
}