serverstatuswidget.h 669 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef SERVERSTATUSWIDGET_H
  2. #define SERVERSTATUSWIDGET_H
  3. #include <QWidget>
  4. #include <QTimer>
  5. #include <QByteArray>
  6. #include "models/downloader.h"
  7. namespace Ui {
  8. class ServerStatusWidget;
  9. }
  10. class ServerStatusWidget : public QWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit ServerStatusWidget(QWidget *parent = 0);
  15. ~ServerStatusWidget();
  16. public slots:
  17. void updateStatus();
  18. private:
  19. QByteArray downloaded_data;
  20. QTimer update_timer;
  21. Downloader downloader;
  22. const QString open_color = "color: rgb(0, 170, 0);";
  23. const QString closed_color = "color: rgb(255, 0, 0);";
  24. private:
  25. Ui::ServerStatusWidget *ui;
  26. };
  27. #endif // SERVERSTATUSWIDGET_H