2014-05-16 02:02:54 +05:30
|
|
|
#pragma once
|
2014-05-17 19:53:48 +05:30
|
|
|
#include <QString>
|
2014-05-16 02:02:54 +05:30
|
|
|
#include <QWidget>
|
2014-05-17 19:53:48 +05:30
|
|
|
#include <QMap>
|
|
|
|
#include <QIcon>
|
2014-05-16 02:02:54 +05:30
|
|
|
#include <memory>
|
|
|
|
|
2014-05-17 19:53:48 +05:30
|
|
|
class IconLabel;
|
2014-05-16 02:02:54 +05:30
|
|
|
class QToolButton;
|
|
|
|
class QHBoxLayout;
|
2015-01-29 13:27:38 +05:30
|
|
|
class StatusChecker;
|
2014-05-16 02:02:54 +05:30
|
|
|
|
|
|
|
class ServerStatus: public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit ServerStatus(QWidget *parent = nullptr, Qt::WindowFlags f = 0);
|
2014-05-17 19:53:48 +05:30
|
|
|
virtual ~ServerStatus();
|
|
|
|
;
|
2014-05-16 02:02:54 +05:30
|
|
|
public slots:
|
|
|
|
void reloadStatus();
|
2014-05-17 19:53:48 +05:30
|
|
|
void StatusChanged(const QMap<QString, QString> statuses);
|
|
|
|
void StatusReloading(bool is_reloading);
|
2014-05-16 02:02:54 +05:30
|
|
|
|
2015-04-19 21:28:53 +05:30
|
|
|
private slots:
|
|
|
|
void clicked();
|
|
|
|
|
2014-05-16 02:02:54 +05:30
|
|
|
private: /* methods */
|
2014-05-17 19:53:48 +05:30
|
|
|
void addLine();
|
|
|
|
void addStatus(QString key, QString name);
|
2014-12-04 05:35:49 +05:30
|
|
|
void setStatus(QString key, int value);
|
2014-05-16 02:02:54 +05:30
|
|
|
private: /* data */
|
|
|
|
QHBoxLayout * layout = nullptr;
|
|
|
|
QToolButton *m_statusRefresh = nullptr;
|
2014-05-17 19:53:48 +05:30
|
|
|
QMap<QString, IconLabel *> serverLabels;
|
|
|
|
QIcon goodIcon;
|
2014-12-04 05:35:49 +05:30
|
|
|
QIcon yellowIcon;
|
2014-05-17 19:53:48 +05:30
|
|
|
QIcon badIcon;
|
2015-01-29 13:27:38 +05:30
|
|
|
std::shared_ptr<StatusChecker> m_statusChecker;
|
2014-05-16 02:02:54 +05:30
|
|
|
};
|