forked from LazyT/rrcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.h
55 lines (40 loc) · 1.41 KB
/
installer.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
#ifndef INSTALLERDLG_H
#define INSTALLERDLG_H
#include "ui_installer.h"
#include "mainwindow.h"
#define VALETUDO_REL "https://api.github.com/repos/hypfer/valetudo/releases"
#define VALETUDO_CFG "https://github.com/Hypfer/Valetudo/raw/master/deployment/valetudo.conf"
#define VALETUDO_BIN_SRC QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/valetudo"
#define VALETUDO_CFG_SRC QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/valetudo.conf"
#define VALETUDO_BIN_DST "/usr/local/bin/valetudo"
#define VALETUDO_CFG_DST "/etc/init/valetudo.conf"
#define VALETUDO_CMD_STOP "service valetudo stop"
#define VALETUDO_CMD_CHMOD "chmod +x /usr/local/bin/valetudo"
#define VALETUDO_CMD_START "service valetudo start"
class installerDialog : public QDialog, private Ui::Dialog_Installer
{
Q_OBJECT
public:
installerDialog(QWidget*);
private:
bool Download(QString);
void updateProgress();
QNetworkReply *reply = NULL;
QByteArray download;
QSshSocket *ssh = NULL;
bool finish, failed;
int step;
private slots:
void getReleases();
void downloadProgress(qint64, qint64);
void finished(QNetworkReply*);
void ssh_connected();
void ssh_disconnected();
void ssh_error(QSshSocket::SshError);
void ssh_loginSuccessful();
void ssh_commandExecuted(QString, QString);
void ssh_pushSuccessful(QString, QString);
void reject();
void on_buttonBox_clicked(QAbstractButton*);
};
#endif // INSTALLERDLG_H