#ifndef SERVERSTATUSWIDGET_H
#define SERVERSTATUSWIDGET_H

#include <QWidget>
#include <QTimer>
#include <QByteArray>
#include "models/downloader.h"

namespace Ui {
class ServerStatusWidget;
}

class ServerStatusWidget : public QWidget
{
    Q_OBJECT

public:
    explicit ServerStatusWidget(QWidget *parent = 0);
    ~ServerStatusWidget();

public slots:
    void updateStatus();

private:
    QByteArray downloaded_data;
    QTimer update_timer;
    Downloader downloader;

    const QString open_color = "color: rgb(0, 170, 0);";
    const QString closed_color = "color: rgb(255, 0, 0);";

private:
    Ui::ServerStatusWidget *ui;
};

#endif // SERVERSTATUSWIDGET_H
