#ifndef INTERNETMONITOR_H #define INTERNETMONITOR_H #include #include #include #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