Skip to content

Commit

Permalink
Show systray error message when there is a network error.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan authored and mgallien committed Feb 7, 2024
1 parent 17ffc06 commit d6df907
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/connectionvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "networkjobs.h"
#include "clientproxy.h"
#include <creds/abstractcredentials.h>
#include "systray.h"

namespace OCC {

Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/gui/connectionvalidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ protected slots:
AccountStatePtr _accountState;
AccountPtr _account;
bool _isCheckingServerAndAuth = false;

void showSystrayErrorMessage();
};
}

Expand Down

0 comments on commit d6df907

Please sign in to comment.