1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00
OpenMW/apps/wizard/mainwizard.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

92 lines
1.9 KiB
C++
Raw Normal View History

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>
#ifndef Q_MOC_RUN
#include <components/files/configurationmanager.hpp>
#include <components/config/gamesettings.hpp>
#include <components/config/launchersettings.hpp>
#endif
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:
struct Installation
{
bool hasMorrowind;
bool hasTribunal;
bool hasBloodmoon;
2013-12-24 22:09:31 +00:00
QString iniPath;
};
2013-12-08 20:35:57 +00:00
enum
{
Page_Intro,
Page_MethodSelection,
Page_LanguageSelection,
2013-12-08 20:35:57 +00:00
Page_ExistingInstallation,
Page_InstallationTarget,
Page_ComponentSelection,
Page_Installation,
Page_Import,
Page_Conclusion
};
MainWizard(Files::ConfigurationManager&& cfgMgr, QWidget* parent = nullptr);
~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);
void runSettingsImporter();
2013-12-24 22:09:31 +00:00
QMap<QString, Installation> mInstallations;
Files::ConfigurationManager mCfgMgr;
Process::ProcessInvoker* mImporterInvoker;
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();
void setupGameSettings();
void setupLauncherSettings();
void setupInstallations();
2013-12-08 20:35:57 +00:00
void setupPages();
void writeSettings();
Config::GameSettings mGameSettings;
Config::LauncherSettings mLauncherSettings;
QString mLogError;
2014-03-30 20:58:50 +00:00
private slots:
void importerStarted();
void importerFinished(int exitCode, QProcess::ExitStatus exitStatus);
void accept() override;
void reject() override;
2013-12-08 20:35:57 +00:00
};
}
#endif // MAINWIZARD_HPP