forked from LazyT/rrcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onlineupd.h
48 lines (36 loc) · 904 Bytes
/
onlineupd.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
#ifndef ONLINEUPDDLG_H
#define ONLINEUPDDLG_H
#include "ui_onlineupd.h"
#include "mainwindow.h"
#ifdef Q_OS_LINUX
#define BIN ".AppImage"
#define IMG ":/png/png/upd_lin.png"
#elif defined Q_OS_WIN
#define BIN ".exe"
#define IMG ":/png/png/upd_win.png"
#elif defined Q_OS_OSX
#define BIN ".dmg"
#define IMG ":/png/png/upd_mac.png"
#endif
#define RELEASE "https://api.github.com/repos/lazyt/rrcc/releases/latest"
class onlineUpdDialog : public QDialog, private Ui::Dialog_OnlineUpdate
{
Q_OBJECT
public:
onlineUpdDialog(QWidget*, bool);
private:
bool silent;
QNetworkAccessManager *netmgr;
QNetworkRequest request;
QNetworkReply *reply;
QByteArray download;
QString url;
int size;
private slots:
void checkUpdate();
void downloadProgress(qint64, qint64);
void finished(QNetworkReply*);
void reject();
void on_buttonBox_clicked(QAbstractButton*);
};
#endif // ONLINEUPDDLG_H