-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmainwindow.h
152 lines (126 loc) · 3.87 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QNetworkAccessManager>
#include <QLabel>
#include <QProcess>
#include <QFuture>
#include <QFutureWatcher>
#include <QTime>
#include <QFile>
#include <QSystemTrayIcon>
#include <QAtomicInt>
#include <QToolButton>
class Settings;
class LoginServers;
class GameProcess;
class SelfUpdater;
class GameMods;
class FileScanner;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
static QString patchUrl;
static QString newsUrl;
static QString gameExecutable;
static const QString version;
static QString selfUpdateUrl;
public slots:
void showSettings();
void statusXmlIsReady(QNetworkReply*);
void startSWG();
void loadFinished();
//void fullScanFinished();
void startFullScan(bool forceConfigRestore = false);
static QVector<QPair<QString, qint64> > getRequiredFiles();
void downloadFinished();
void downloadFileFinished(QNetworkReply *reply);
void readBasiliskServerStatus();
void readNovaServerStatus();
void webPageLoadFinished(bool ok);
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void closeEvent(QCloseEvent *event);
void triggerNews();
void updateBasicLoadProgress(QString successFile);
void updateFullScanProgress(QString successFile, bool success);
void triggerMultipleInstances(bool newValue);
void startFileDownload();
void updateServerStatus();
void updateLoginServerList();
void gameProcessFinished(GameProcess* process, int);
void closeTab(int index);
void checkForUpdates();
void requiredFileDownloadFileFinished(QNetworkReply* reply);
void patchesDownloadFileFinished(QNetworkReply* reply);
void runUpdateCheckTimer();
void startSWGSetup();
void showAboutDialog();
QFile* getRequiredFilesFile();
void systemTrayActivated(QSystemTrayIcon::ActivationReason reason);
void deleteProfiles();
void startLoadBasicCheck();
void showGameModsOptions();
void showMacroEditor();
void updateDonationMeter();
//void fullScanFile(const QString& file, const QString& name, qint64, const QString &md5);
void addFileToDownloadSlot(QString file);
//int fullScanSingleThreaded(bool);
//void fullScanMultiThreaded(bool);
void toolBarOrientationChanged(Qt::Orientation);
void startKodanCalculator();
void installSWGEmu();
void enableStart();
bool decrementFullScanWorkingThreads() {
return fullScanWorkingThreads.deref();
}
volatile bool doCancelWorkingThreads() {
return cancelWorkingThreads;
}
void appendToFilesToDownloadStringList(const QString& file) {
filesToDownload.append(file);
}
signals:
void startDownload();
//void requiredFileExists(QString);
//void fullScannedFile(QString, bool);
void fileDownloaded(QString);
//void addFileToDownload(QString);
private:
Ui::MainWindow *ui;
LoginServers* loginServers;
Settings* settings;
QNetworkAccessManager networkAccessManager;
QNetworkAccessManager clientFilesNetworkAccessManager;
QNetworkAccessManager novaNetworkAccessManager;
QNetworkAccessManager requiredFilesNetworkManager;
QNetworkAccessManager patchesNetworkManager;
QFutureWatcher<int> loadWatcher;
QFutureWatcher<int> fullScanWatcher;
QFutureWatcher<int> downloadWatcher;
volatile bool cancelWorkingThreads;
QStringList filesToDownload;
int requiredFilesCount;
int currentReadFiles;
int nextFileToDownload;
QTime lastReceivedBytesTime;
quint64 lastReceivedBytes;
QVector<GameProcess*> gameProcesses;
SelfUpdater* silentSelfUpdater;
QSystemTrayIcon* systemTrayIcon;
QMenu* systemTrayMenu;
QAction* closeAction;
volatile bool runningFullScan;
int gameProcessesCount;
int updateTimeCounter;
QAtomicInt fullScanWorkingThreads;
QVector<QToolButton*> toolButtons;
FileScanner* fileScanner;
//GameMods* gameMods;
};
#endif // MAINWINDOW_H