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