summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2017-03-09 17:04:15 +0100
committerKai Uwe Broulik <[email protected]>2017-03-09 17:04:15 +0100
commitbdba2968be46026defc17a85aed450426f7cde91 (patch)
tree9b91e1ef12e062150e723204321b0571fddb5bdf
parentf98a90df2541af27e9063ab48741c3c09c08b52b (diff)
[Notifications] Add "Properties" for thumbnail context menu
Makes it behave even more like a file context menu
-rw-r--r--applets/notifications/plugin/thumbnailer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/applets/notifications/plugin/thumbnailer.cpp b/applets/notifications/plugin/thumbnailer.cpp
index 418cba6..5bb95f4 100644
--- a/applets/notifications/plugin/thumbnailer.cpp
+++ b/applets/notifications/plugin/thumbnailer.cpp
@@ -33,6 +33,7 @@
#include <KFileItemListProperties>
#include <KLocalizedString>
#include <KProtocolManager>
+#include <KPropertiesDialog>
#include <KUrlMimeData>
#include <KIO/OpenFileManagerWindowJob>
@@ -147,6 +148,13 @@ void Thumbnailer::showContextMenu(int x, int y, const QString &path, QQuickItem
actions->addServiceActionsTo(menu);
actions->addPluginActionsTo(menu);
+ QAction *propertiesAction = menu->addAction(QIcon::fromTheme("document-properties"), i18n("Properties"));
+ connect(propertiesAction, &QAction::triggered, [fileItem] {
+ KPropertiesDialog *dialog = new KPropertiesDialog(fileItem.url());
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->show();
+ });
+
if (menu->isEmpty()) {
delete menu;
return;