Add desktop notification about failed captures
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user