-
Notifications
You must be signed in to change notification settings - Fork 18
/
mainwindow.h
97 lines (70 loc) · 1.94 KB
/
mainwindow.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QCloseEvent>
#include <QProcess>
#include <QNetworkReply>
#include <QSettings>
#include "portforwardingwindow/portforwardingwindow.h"
#include "zjuconnectcontroller/zjuconnectcontroller.h"
#include "networkdetector/networkdetector.h"
#include "settingwindow/settingwindow.h"
#include "QrCodeGenerator/QrCodeGenerator.h"
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow() override;
public slots:
void cleanUpWhenQuit();
signals:
void SetModeFinished();
protected:
void closeEvent(QCloseEvent *e) override;
private:
void upgradeSettings();
void clearLog();
void addLog(const QString &log);
void showNotification(
const QString &title,
const QString &content,
QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::MessageIcon::Information
);
void setModeToL2tp();
void setModeToWebLogin();
void setModeToZjuConnect();
Ui::MainWindow *ui;
QSystemTrayIcon *trayIcon;
QMenu *trayMenu;
QAction *trayShowAction;
QAction *trayCloseAction;
ZjuConnectController *zjuConnectController;
NetworkDetector *networkDetector;
QNetworkAccessManager *networkAccessManager;
QSettings *settings;
QProcess *process;
QProcess *processForL2tp;
QProcess *processForL2tpCheck;
QProcess *processForWebLogin;
QTimer *l2tpCheckTimer;
QrCodeGenerator qrGenerator;
QObject *diagnosisContext;
SettingWindow *settingWindow;
QString mode;
NetworkDetectResult networkDetectResult;
bool isFirstTimeSetMode;
bool isL2tpLinked;
bool isL2tpReconnecting;
bool isWebLogged;
bool isZjuConnectLinked;
bool isZjuConnectLoginError;
bool isZjuConnectAccessDenied;
bool isSystemProxySet;
};
#endif //MAINWINDOW_H