#ifndef UPGRADE_H
#define UPGRADE_H

#include <QWidget>
#include "CHttpBll.h"

namespace Ui {
class upgrade;
}

struct UpdateInfo
{
    int nType; //1：机构信息 2：版本信息 3：升级文件
    QString sUrl;
    QString sDestFileName;
    QString sMd5;
    UpdateInfo()
    {
        nType = 0;
        sUrl = "";
        sDestFileName = "";
        sMd5 = "";
    }
};

class upgrade : public QWidget
{
    Q_OBJECT

signals:
    void updateSucceed(bool bUpdateOeLauncher);
    void exitUpgrade();
public:
    explicit upgrade(QWidget *parent = nullptr);
    ~upgrade();

    void startUpgrade(QList<UpdateInfo> sList);

private slots:
    void onDownLoadFile(CDownLoadFileInfo downLoadFileInfo);  
private:
    void initUI();
    void retry();

    Ui::upgrade *ui;

    UpdateInfo m_curInfo;
    QList<UpdateInfo> m_sList;


    bool m_bUpdateOeLauncher;
};

#endif // UPGRADE_H
