#ifndef COMMONBUTTONGROUPWIDGET_H
#define COMMONBUTTONGROUPWIDGET_H

#include <QWidget>

#include <Core/tcpclient.h>

namespace Ui {
class CommonButtonGroupWidget;
}

class TCPClient;
class ExternalExecuter;
class SendSystem;

class CommonButtonGroupWidget : public QWidget
{
    Q_OBJECT

public:
    explicit CommonButtonGroupWidget(QWidget *parent = nullptr);
    void initialize(ExternalExecuter *extExec,SendSystem *sendSystem,TCPClient *client);
    void loadCompleteState();
    void lastVerInstalledState();
    void disconnectState();
    void startUpdateState();
    void showProgressBar(bool flag);
    void needUpdateState(bool flag);
    void startButtonActive(bool flag);
    ~CommonButtonGroupWidget();

signals:
    void sigSendCommand(QString command);
    void sigSendXMLAnswer(QString answer);

private slots:
    void on_updateButton_clicked();
    void on_startButton_clicked();

public:
    void updateProgressBar(float value);

private:
    Ui::CommonButtonGroupWidget *ui;
    ExternalExecuter *externalExecuter;
    SendSystem *sendSystem;
};

#endif // COMMONBUTTONGROUPWIDGET_H
