PrismLauncher/launcher/minecraft/ComponentUpdateTask.h

33 lines
719 B
C
Raw Normal View History

#pragma once
#include "net/Mode.h"
#include "tasks/Task.h"
#include <memory>
class PackProfile;
struct ComponentUpdateTaskData;
class ComponentUpdateTask : public Task {
2018-07-15 13:51:05 +01:00
Q_OBJECT
public:
enum class Mode { Launch, Resolution };
public:
explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, PackProfile* list, QObject* parent = 0);
2018-07-15 13:51:05 +01:00
virtual ~ComponentUpdateTask();
protected:
2018-07-15 13:51:05 +01:00
void executeTask();
private:
2018-07-15 13:51:05 +01:00
void loadComponents();
void resolveDependencies(bool checkOnly);
2018-07-15 13:51:05 +01:00
void remoteLoadSucceeded(size_t index);
void remoteLoadFailed(size_t index, const QString& msg);
2018-07-15 13:51:05 +01:00
void checkIfAllFinished();
private:
2018-07-15 13:51:05 +01:00
std::unique_ptr<ComponentUpdateTaskData> d;
};