diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-05-17 16:23:48 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-05-17 16:23:48 +0200 |
commit | 8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02 (patch) | |
tree | ad53f17dde79b5c23534c7b0e869852f94a66d84 /gui/widgets/ServerStatus.h | |
parent | 927217c7f06017db23b232f055dd5343e39d871f (diff) | |
download | MultiMC-8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02.tar MultiMC-8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02.tar.gz MultiMC-8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02.tar.lz MultiMC-8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02.tar.xz MultiMC-8a8c4193e6ee7cd55870ef8495cb7cc3b9534e02.zip |
Finish status pills.
Diffstat (limited to 'gui/widgets/ServerStatus.h')
-rw-r--r-- | gui/widgets/ServerStatus.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gui/widgets/ServerStatus.h b/gui/widgets/ServerStatus.h index a116d3d4..2244031b 100644 --- a/gui/widgets/ServerStatus.h +++ b/gui/widgets/ServerStatus.h @@ -1,7 +1,11 @@ #pragma once +#include <QString> #include <QWidget> +#include <QMap> +#include <QIcon> #include <memory> +class IconLabel; class QToolButton; class QHBoxLayout; @@ -10,23 +14,21 @@ class ServerStatus: public QWidget Q_OBJECT public: explicit ServerStatus(QWidget *parent = nullptr, Qt::WindowFlags f = 0); - virtual ~ServerStatus() {}; + virtual ~ServerStatus(); + ; public slots: - void updateStatusUI(); - - void updateStatusFailedUI(); - void reloadStatus(); - void StatusChanged(); + void StatusChanged(const QMap<QString, QString> statuses); + void StatusReloading(bool is_reloading); private: /* methods */ - clear(); - addLine(); - addStatus(QString name, bool online); + void addLine(); + void addStatus(QString key, QString name); + void setStatus(QString key, bool value); private: /* data */ QHBoxLayout * layout = nullptr; QToolButton *m_statusRefresh = nullptr; - QPixmap goodIcon; - QPixmap badIcon; - QTimer statusTimer; + QMap<QString, IconLabel *> serverLabels; + QIcon goodIcon; + QIcon badIcon; }; |