From d6df90796197f1203cf8586966a671d5bd97b4c6 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Fri, 2 Feb 2024 12:46:31 +0100 Subject: [PATCH] Show systray error message when there is a network error. Signed-off-by: Camila Ayres --- src/gui/connectionvalidator.cpp | 9 +++++++++ src/gui/connectionvalidator.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/gui/connectionvalidator.cpp b/src/gui/connectionvalidator.cpp index f9b149787ed0..f59d28b3383a 100644 --- a/src/gui/connectionvalidator.cpp +++ b/src/gui/connectionvalidator.cpp @@ -27,6 +27,7 @@ #include "networkjobs.h" #include "clientproxy.h" #include +#include "systray.h" namespace OCC { @@ -328,7 +329,15 @@ void ConnectionValidator::reportConnected() { void ConnectionValidator::reportResult(Status status) { emit connectionResult(status, _errors); + showSystrayErrorMessage(); deleteLater(); } +void ConnectionValidator::showSystrayErrorMessage() +{ + Systray::instance()->showMessage(tr("Network Error"), + _errors.join("
"), + QSystemTrayIcon::Warning); +} + } // namespace OCC diff --git a/src/gui/connectionvalidator.h b/src/gui/connectionvalidator.h index bd955d4128e6..22f8ce686e1b 100644 --- a/src/gui/connectionvalidator.h +++ b/src/gui/connectionvalidator.h @@ -146,6 +146,8 @@ protected slots: AccountStatePtr _accountState; AccountPtr _account; bool _isCheckingServerAndAuth = false; + + void showSystrayErrorMessage(); }; }