add more options to copy instance dialog

- Copy game options, copy resource packs, copy shaders,
copy servers, and copy mods
- Also made a new InstanceCopyPrefs struct to store those
options rather than passing 7 different booleans into
InstanceCopyTask's constructor

Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
This commit is contained in:
Marcelo Hernandez
2022-10-22 14:50:32 -04:00
parent 8b28ed67ae
commit e7e56eb1e3
8 changed files with 254 additions and 22 deletions

View File

@ -1,20 +1,21 @@
#pragma once
#include "tasks/Task.h"
#include "net/NetJob.h"
#include <QUrl>
#include <QFuture>
#include <QFutureWatcher>
#include "settings/SettingsObject.h"
#include "BaseVersion.h"
#include <QUrl>
#include "BaseInstance.h"
#include "BaseVersion.h"
#include "InstanceCopyPrefs.h"
#include "InstanceTask.h"
#include "net/NetJob.h"
#include "settings/SettingsObject.h"
#include "tasks/Task.h"
class InstanceCopyTask : public InstanceTask
{
Q_OBJECT
public:
explicit InstanceCopyTask(InstancePtr origInstance, bool copySaves, bool keepPlaytime);
explicit InstanceCopyTask(InstancePtr origInstance, InstanceCopyPrefs prefs);
protected:
//! Entry point for tasks.
@ -22,7 +23,12 @@ protected:
void copyFinished();
void copyAborted();
private: /* data */
private:
// Helper functions to avoid repeating code
static void appendToFilter(QString &filter, const QString &append);
void resetFromMatcher(const QString &regexp);
/* data */
InstancePtr m_origInstance;
QFuture<bool> m_copyFuture;
QFutureWatcher<bool> m_copyFutureWatcher;