diff --git a/src/SpectacleCore.cpp b/src/SpectacleCore.cpp --- a/src/SpectacleCore.cpp +++ b/src/SpectacleCore.cpp @@ -26,6 +26,7 @@ #endif #include "PlatformBackends/KWinWaylandImageGrabber.h" +#include #include #include #include @@ -256,13 +257,24 @@ notify->setText(i18n("A screenshot was saved as '%1' to '%2'.", savedAt.fileName(), path)); } - notify->setActions({i18nc("Open the screenshot we just saved", "Open")}); + const QStringList actions = { + i18nc("Open the screenshot we just saved", "Open"), + i18nc("Show the screenshot in the folder where it was saved", "Open containing folder") + }; + notify->setActions(actions); notify->setUrls({savedAt}); + // "Open screenshot" action connect(notify, &KNotification::action1Activated, this, [this, savedAt] { new KRun(savedAt, nullptr); QTimer::singleShot(250, this, &SpectacleCore::allDone); }); + + // "Open containing folder" action + connect(notify, &KNotification::action2Activated, this, [this, savedAt] { + KIO::highlightInFileManager({savedAt}); + QTimer::singleShot(250, this, &SpectacleCore::allDone); + }); connect(notify, &QObject::destroyed, this, &SpectacleCore::allDone); notify->sendEvent();