Implémentation détection internet

This commit is contained in:
2024-01-13 14:02:37 -05:00
parent 40093d5acf
commit 098863edb9
21 changed files with 1341 additions and 54 deletions
+37
View File
@@ -0,0 +1,37 @@
#ifndef INTERNETMONITOR_H
#define INTERNETMONITOR_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QTimer>
#define INTERNET_MONITOR_CONNECTION_TIMEOUT 2000
#define INTERNET_MONITOR_INET_CHECK_TIMEOUT 5000
class CInternetMonitor : public QObject
{
Q_OBJECT
public:
explicit CInternetMonitor(QObject *parent = 0);
~CInternetMonitor();
int Start();
bool IsInternetActive();
private:
QNetworkAccessManager *mNetMgr;
bool mInternetActive;
QTimer *mCheckInternetStateTimer, *mConnectionTimer;
int CheckInternet();
signals:
void InternetStateChanged(bool);
public slots:
void NetworkReqfinished(QNetworkReply *reply);
void CheckInternetTimerExpired();
void ConnectionTimerExpired();
};
#endif // INTERNETMONITOR_H