2013-12-08 20:35:57 +00:00
|
|
|
#ifndef MAINWIZARD_HPP
|
|
|
|
#define MAINWIZARD_HPP
|
|
|
|
|
2022-10-10 11:41:36 +00:00
|
|
|
#include <QProcess>
|
2013-12-08 20:35:57 +00:00
|
|
|
#include <QWizard>
|
|
|
|
|
2014-05-29 18:35:07 +00:00
|
|
|
#ifndef Q_MOC_RUN
|
2013-12-25 14:50:02 +00:00
|
|
|
#include <components/files/configurationmanager.hpp>
|
2018-12-01 20:27:43 +00:00
|
|
|
|
2013-12-25 14:50:02 +00:00
|
|
|
#include <components/config/gamesettings.hpp>
|
2014-04-16 21:59:25 +00:00
|
|
|
#include <components/config/launchersettings.hpp>
|
2018-12-01 20:27:43 +00:00
|
|
|
#endif
|
2013-12-25 14:50:02 +00:00
|
|
|
|
2022-10-10 11:41:36 +00:00
|
|
|
namespace Process
|
|
|
|
{
|
|
|
|
class ProcessInvoker;
|
|
|
|
}
|
|
|
|
|
2013-12-08 20:35:57 +00:00
|
|
|
namespace Wizard
|
|
|
|
{
|
|
|
|
class MainWizard : public QWizard
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-12-13 12:38:49 +00:00
|
|
|
struct Installation
|
|
|
|
{
|
|
|
|
bool hasMorrowind;
|
|
|
|
bool hasTribunal;
|
|
|
|
bool hasBloodmoon;
|
2013-12-24 22:09:31 +00:00
|
|
|
|
|
|
|
QString iniPath;
|
2013-12-13 12:38:49 +00:00
|
|
|
};
|
|
|
|
|
2013-12-08 20:35:57 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
Page_Intro,
|
|
|
|
Page_MethodSelection,
|
2013-12-13 14:30:49 +00:00
|
|
|
Page_LanguageSelection,
|
2013-12-08 20:35:57 +00:00
|
|
|
Page_ExistingInstallation,
|
|
|
|
Page_InstallationTarget,
|
|
|
|
Page_ComponentSelection,
|
|
|
|
Page_Installation,
|
|
|
|
Page_Import,
|
|
|
|
Page_Conclusion
|
|
|
|
};
|
|
|
|
|
2024-02-28 00:49:15 +00:00
|
|
|
MainWizard(Files::ConfigurationManager&& cfgMgr, QWidget* parent = nullptr);
|
2021-05-19 00:42:24 +00:00
|
|
|
~MainWizard() override;
|
2013-12-08 20:35:57 +00:00
|
|
|
|
2013-12-24 22:09:31 +00:00
|
|
|
bool findFiles(const QString& name, const QString& path);
|
|
|
|
void addInstallation(const QString& path);
|
2014-02-25 14:33:30 +00:00
|
|
|
void runSettingsImporter();
|
2013-12-24 22:09:31 +00:00
|
|
|
|
2014-04-17 00:15:06 +00:00
|
|
|
QMap<QString, Installation> mInstallations;
|
2013-12-13 12:38:49 +00:00
|
|
|
|
2013-12-25 14:50:02 +00:00
|
|
|
Files::ConfigurationManager mCfgMgr;
|
|
|
|
|
2014-04-18 11:17:37 +00:00
|
|
|
Process::ProcessInvoker* mImporterInvoker;
|
|
|
|
|
2014-01-28 00:03:47 +00:00
|
|
|
bool mError;
|
|
|
|
|
2014-03-30 20:58:50 +00:00
|
|
|
public slots:
|
|
|
|
void addLogText(const QString& text);
|
|
|
|
|
2013-12-08 20:35:57 +00:00
|
|
|
private:
|
2014-03-30 20:58:50 +00:00
|
|
|
void setupLog();
|
2014-02-25 14:33:30 +00:00
|
|
|
void setupGameSettings();
|
2014-04-16 21:59:25 +00:00
|
|
|
void setupLauncherSettings();
|
2013-12-13 12:38:49 +00:00
|
|
|
void setupInstallations();
|
2013-12-08 20:35:57 +00:00
|
|
|
void setupPages();
|
2013-12-13 12:38:49 +00:00
|
|
|
|
2013-12-25 14:50:02 +00:00
|
|
|
void writeSettings();
|
|
|
|
|
|
|
|
Config::GameSettings mGameSettings;
|
2014-04-16 21:59:25 +00:00
|
|
|
Config::LauncherSettings mLauncherSettings;
|
2013-12-25 14:50:02 +00:00
|
|
|
|
2014-04-18 11:17:37 +00:00
|
|
|
QString mLogError;
|
2014-03-30 20:58:50 +00:00
|
|
|
|
2013-12-25 14:50:02 +00:00
|
|
|
private slots:
|
2014-04-17 00:15:06 +00:00
|
|
|
|
|
|
|
void importerStarted();
|
|
|
|
void importerFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void accept() override;
|
|
|
|
void reject() override;
|
2013-12-08 20:35:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // MAINWIZARD_HPP
|