code_app/app/fwupgrade/dialog_updateprogress.h

47 lines
1.1 KiB
C
Raw Permalink Normal View History

#ifndef DIALOG_UPDATEPROGRESS_H
#define DIALOG_UPDATEPROGRESS_H
#include <QDialog>
#include "base/HGThread.h"
#include "version/HGVersion.h"
#include "mainwindow.h"
namespace Ui {
class Dialog_updateProgress;
}
class Dialog_updateProgress : public QDialog
{
Q_OBJECT
public:
explicit Dialog_updateProgress(HGVersionMgr versionMgr, const QString &url,
const QString &savePath, QWidget *parent = nullptr);
~Dialog_updateProgress();
private:
static HGInt HGAPI HttpDownloadThreadFunc(HGULonglong totalSize, HGULonglong nowSize, HGPointer param);
static void HGAPI ThreadFunc(HGThread thread, HGPointer param);
signals:
void updateProgress(int value);
void finish();
private slots:
void on_updateProgress(int value);
void on_finish();
void on_pushButton_clicked();
protected:
virtual void closeEvent(QCloseEvent* e);
private:
Ui::Dialog_updateProgress *ui;
HGVersionMgr m_versionMgr;
QString m_url;
QString m_savePath;
bool m_stopThread;
HGThread m_thread;
};
#endif // DIALOG_UPDATEPROGRESS_H