1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00
astra/include/assetupdater.h
Joshua Goins d939d26280 Overhauled asset updating process (again)
Now the code is much cleaner, should be less error prone. And best of
all, the process is now user-visible in a nice progress box.
2022-03-13 20:44:57 -04:00

52 lines
1.1 KiB
C++

#pragma once
#include <QObject>
#include <QTemporaryDir>
#include <QProgressDialog>
#include <QJsonArray>
class LauncherCore;
class QNetworkReply;
struct ProfileSettings;
class AssetUpdater : public QObject {
Q_OBJECT
public:
AssetUpdater(LauncherCore& launcher);
void update(const ProfileSettings& profile);
void beginInstall();
void checkIfCheckingIsDone();
void checkIfDalamudAssetsDone();
void checkIfFinished();
signals:
void finishedUpdating();
private:
LauncherCore& launcher;
QProgressDialog* dialog;
const ProfileSettings* currentSettings = nullptr;
QString remoteDalamudVersion;
QString remoteRuntimeVersion;
QTemporaryDir tempDir;
bool doneDownloadingDalamud = true;
bool doneDownloadingNativelauncher = true;
bool doneDownloadingRuntimeCore = true;
bool doneDownloadingRuntimeDesktop = true;
bool needsRuntimeInstall = false;
bool needsDalamudInstall = false;
bool needsNativeInstall = false;
int remoteDalamudAssetVersion = -1;
QList<QString> dalamudAssetNeededFilenames;
QJsonArray remoteDalamudAssetArray;
QString dataDir;
};