1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-22 12:47:44 +00:00
astra/include/assetupdater.h
Joshua Goins 50ad93ee8f Add native launcher update support
When updating to this new commit, you will download the 1.1.0 release
automatically since we create a new version file.

This commit also fixes a bug where in certain cases the asset updating
process could end early.

The native launcher version is also visible from the settings window!
2022-04-08 19:34:51 -04:00

53 lines
1.2 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;
QString remoteNativeLauncherVersion;
QTemporaryDir tempDir;
bool doneDownloadingDalamud = false;
bool doneDownloadingNativelauncher = false;
bool doneDownloadingRuntimeCore = false;
bool doneDownloadingRuntimeDesktop = false;
bool needsRuntimeInstall = false;
bool needsDalamudInstall = false;
bool needsNativeInstall = false;
int remoteDalamudAssetVersion = -1;
QList<QString> dalamudAssetNeededFilenames;
QJsonArray remoteDalamudAssetArray;
QString dataDir;
};