From 485bc58b9d78bedaed10c4612265f29848865077 Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Fri, 10 Nov 2017 19:56:59 +0100 Subject: [PATCH] Add desktop notification about failed captures --- src/capture/widget/capturewidget.cpp | 1 + src/core/flameshotdbusadapter.cpp | 3 ++- src/main.cpp | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/capture/widget/capturewidget.cpp b/src/capture/widget/capturewidget.cpp index 10a8abbe..d3bfbfe9 100644 --- a/src/capture/widget/capturewidget.cpp +++ b/src/capture/widget/capturewidget.cpp @@ -87,6 +87,7 @@ CaptureWidget::CaptureWidget(const uint id, const QString &forcedSavePath, bool ok = true; QPixmap fullScreenshot(ScreenGrabber().grabEntireDesktop(ok)); if(!ok) { + SystemNotification().sendMessage(tr("Unable to capture screen")); this->close(); } m_screenshot = new Screenshot(fullScreenshot, this); diff --git a/src/core/flameshotdbusadapter.cpp b/src/core/flameshotdbusadapter.cpp index a4092fe7..60498d78 100644 --- a/src/core/flameshotdbusadapter.cpp +++ b/src/core/flameshotdbusadapter.cpp @@ -20,6 +20,7 @@ #include "src/utils/screengrabber.h" #include "src/core/controller.h" #include "src/core/resourceexporter.h" +#include "src/utils/systemnotification.h" #include #include #include @@ -70,7 +71,7 @@ void FlameshotDBusAdapter::fullScreen( bool ok = true; QPixmap p(ScreenGrabber().grabEntireDesktop(ok)); if (!ok) { - // TODO notify + SystemNotification().sendMessage(tr("Unable to capture screen")); Q_EMIT captureFailed(id); return; } diff --git a/src/main.cpp b/src/main.cpp index 9e28cfeb..35220699 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -188,7 +188,6 @@ int main(int argc, char *argv[]) { sessionBus.call(m); if (isRaw) { - // TODO // captureTaken sessionBus.connect("org.dharkael.Flameshot", "/", "", "captureTaken", @@ -225,7 +224,6 @@ int main(int argc, char *argv[]) { sessionBus.call(m); if (isRaw) { - // TODO // captureTaken sessionBus.connect("org.dharkael.Flameshot", "/", "", "captureTaken",