diff options
Diffstat (limited to 'gui/widgets/ServerStatus.h')
-rw-r--r-- | gui/widgets/ServerStatus.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gui/widgets/ServerStatus.h b/gui/widgets/ServerStatus.h new file mode 100644 index 00000000..2244031b --- /dev/null +++ b/gui/widgets/ServerStatus.h @@ -0,0 +1,34 @@ +#pragma once +#include <QString> +#include <QWidget> +#include <QMap> +#include <QIcon> +#include <memory> + +class IconLabel; +class QToolButton; +class QHBoxLayout; + +class ServerStatus: public QWidget +{ + Q_OBJECT +public: + explicit ServerStatus(QWidget *parent = nullptr, Qt::WindowFlags f = 0); + virtual ~ServerStatus(); + ; +public slots: + void reloadStatus(); + void StatusChanged(const QMap<QString, QString> statuses); + void StatusReloading(bool is_reloading); + +private: /* methods */ + void addLine(); + void addStatus(QString key, QString name); + void setStatus(QString key, bool value); +private: /* data */ + QHBoxLayout * layout = nullptr; + QToolButton *m_statusRefresh = nullptr; + QMap<QString, IconLabel *> serverLabels; + QIcon goodIcon; + QIcon badIcon; +}; |