From 8f22cb1854674da468ab5aeb8ab591dd742e15a4 Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Tue, 16 May 2017 23:40:27 +0200 Subject: [PATCH] Add notification when uploading images --- capture/capturewidget.cpp | 1 + capture/capturewidget.h | 3 +++ controller.cpp | 6 ++++++ controller.h | 1 + 4 files changed, 11 insertions(+) diff --git a/capture/capturewidget.cpp b/capture/capturewidget.cpp index 8d1e0da5..06e84204 100644 --- a/capture/capturewidget.cpp +++ b/capture/capturewidget.cpp @@ -355,6 +355,7 @@ void CaptureWidget::uploadScreenshot() { s.uploadToImgur(am, getExtendedSelection()); } hide(); + Q_EMIT newMessage("Uploading image..."); } void CaptureWidget::undo() { diff --git a/capture/capturewidget.h b/capture/capturewidget.h index f4c6628e..7e0bbd8a 100644 --- a/capture/capturewidget.h +++ b/capture/capturewidget.h @@ -44,6 +44,9 @@ public: void redefineButtons(); +signals: + void newMessage(QString); + private slots: void saveScreenshot(); void copyScreenshot(); diff --git a/controller.cpp b/controller.cpp index 73ea2b26..96e3bd4b 100644 --- a/controller.cpp +++ b/controller.cpp @@ -101,6 +101,8 @@ void Controller::initDefaults() { void Controller::slotPrintHotkey() { if (!m_captureWindow) { m_captureWindow = new CaptureWidget(); + connect(m_captureWindow, &CaptureWidget::newMessage, + this, &Controller::showMessage); } } @@ -117,3 +119,7 @@ void Controller::openInfoWindow() { m_infoWindow = new InfoWindow(); } } + +void Controller::showMessage(QString msg) { + m_trayIcon->showMessage("Flameshot Info", msg); +} diff --git a/controller.h b/controller.h index 0d647640..b6398500 100644 --- a/controller.h +++ b/controller.h @@ -38,6 +38,7 @@ private slots: void slotPrintHotkey(); void openConfigWindow(); void openInfoWindow(); + void showMessage(QString); private: void createActions();