Add desktop notification about failed captures

This commit is contained in:
lupoDharkael
2017-11-10 19:56:59 +01:00
parent bb6ac04d60
commit 485bc58b9d
3 changed files with 3 additions and 3 deletions

View File

@@ -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);

View File

@@ -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 <QTimer>
#include <functional>
#include <QBuffer>
@@ -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;
}

View File

@@ -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",