Show systray error message when there is a network error.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2024-02-02 12:46:31 +01:00
parent 9dbf43c6fd
commit 1b305e4c6a
2 changed files with 11 additions and 0 deletions

View file

@ -27,6 +27,7 @@
#include "networkjobs.h"
#include "clientproxy.h"
#include <creds/abstractcredentials.h>
#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("<br>"),
QSystemTrayIcon::Warning);
}
} // namespace OCC

View file

@ -146,6 +146,8 @@ private:
AccountStatePtr _accountState;
AccountPtr _account;
bool _isCheckingServerAndAuth = false;
void showSystrayErrorMessage();
};
}