2016-10-03 04:25:54 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tasks/Task.h"
|
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
#include "net/NetJob.h"
|
|
|
|
#include <QUrl>
|
2016-10-26 21:42:33 +05:30
|
|
|
#include <QFuture>
|
|
|
|
#include <QFutureWatcher>
|
2016-10-03 04:25:54 +05:30
|
|
|
#include "settings/SettingsObject.h"
|
|
|
|
#include "BaseVersion.h"
|
|
|
|
#include "BaseInstance.h"
|
|
|
|
|
2016-10-26 21:42:33 +05:30
|
|
|
|
2016-10-03 04:25:54 +05:30
|
|
|
class BaseInstanceProvider;
|
|
|
|
|
|
|
|
class MULTIMC_LOGIC_EXPORT InstanceCopyTask : public Task
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-09-06 03:08:17 +05:30
|
|
|
explicit InstanceCopyTask(SettingsObjectPtr settings, const QString & stagingPath, InstancePtr origInstance, const QString &instName,
|
2016-10-03 04:25:54 +05:30
|
|
|
const QString &instIcon, const QString &instGroup, bool copySaves);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
//! Entry point for tasks.
|
|
|
|
virtual void executeTask() override;
|
2016-10-26 21:42:33 +05:30
|
|
|
void copyFinished();
|
|
|
|
void copyAborted();
|
2016-10-03 04:25:54 +05:30
|
|
|
|
|
|
|
private: /* data */
|
|
|
|
SettingsObjectPtr m_globalSettings;
|
|
|
|
InstancePtr m_origInstance;
|
|
|
|
QString m_instName;
|
|
|
|
QString m_instIcon;
|
|
|
|
QString m_instGroup;
|
2016-10-26 21:42:33 +05:30
|
|
|
QString m_stagingPath;
|
|
|
|
QFuture<bool> m_copyFuture;
|
|
|
|
QFutureWatcher<bool> m_copyFutureWatcher;
|
2016-12-09 02:28:31 +05:30
|
|
|
std::unique_ptr<IPathMatcher> m_matcher;
|
2016-10-03 04:25:54 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
|