Finish status pills.
This commit is contained in:
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user