-
Notifications
You must be signed in to change notification settings - Fork 26
/
autoupdatedialog.h
65 lines (52 loc) · 1.31 KB
/
autoupdatedialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef AUTOUPDATEDIALOG_H
#define AUTOUPDATEDIALOG_H
#include <QDebug>
#include <QDialog>
#include <QDir>
#include <QFile>
#include <QMessageBox>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QProcess>
#include <QTextEdit>
#include <QTextStream>
#include <QtMath>
namespace Ui {
class AutoUpdateDialog;
}
class AutoUpdateDialog : public QDialog {
Q_OBJECT
public:
explicit AutoUpdateDialog(QWidget* parent = nullptr);
~AutoUpdateDialog();
Ui::AutoUpdateDialog* ui;
QString tempDir;
QString filename;
QNetworkAccessManager* manager;
QNetworkReply* reply;
QFile* myfile;
void Init();
void doProcessReadyRead();
void doProcessFinished();
void doProcessDownloadProgress(qint64, qint64);
void startUpdate();
void startDownload(bool Database);
QString strUrl;
QString strWinUrl;
QString strMacUrl;
QString strDatabaseUrl;
QString strMacClassicalUrl;
QString strLinuxUrl;
QString strLinuxTargetFile;
QString GetFileSize(qint64 size);
void TextEditToFile(QTextEdit* txtEdit, QString fileName);
QString GetFileSize(const qint64& size, int precision);
protected:
void closeEvent(QCloseEvent* event);
void keyPressEvent(QKeyEvent* event);
private slots:
void on_btnStartUpdate_clicked();
private:
};
#endif // AUTOUPDATEDIALOG_H