1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/apps/launcher/maindialog.hpp

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

103 lines
2.4 KiB
C++
Raw Normal View History

2011-04-08 00:04:09 +02:00
#ifndef MAINDIALOG_H
#define MAINDIALOG_H
#ifndef Q_MOC_RUN
#include <components/files/configurationmanager.hpp>
#include <components/process/processinvoker.hpp>
#include <components/config/gamesettings.hpp>
#include <components/config/launchersettings.hpp>
#endif
#include "ui_mainwindow.h"
2011-04-08 00:04:09 +02:00
class QListWidgetItem;
2014-01-27 20:14:02 +01:00
class QStackedWidget;
class QStringList;
class QStringListModel;
class QString;
2011-04-08 00:04:09 +02:00
2013-10-25 11:17:26 -05:00
namespace Launcher
2011-04-08 00:04:09 +02:00
{
2013-10-25 11:17:26 -05:00
class PlayPage;
class GraphicsPage;
class DataFilesPage;
class UnshieldThread;
2014-01-27 20:14:02 +01:00
class SettingsPage;
class AdvancedPage;
2013-10-25 11:17:26 -05:00
2015-05-17 10:38:15 +02:00
enum FirstRunDialogResult
{
FirstRunDialogResultFailure,
FirstRunDialogResultContinue,
FirstRunDialogResultWizard
2015-05-17 10:38:15 +02:00
};
2013-10-25 11:17:26 -05:00
#ifndef WIN32
bool expansions(Launcher::UnshieldThread& cd);
#endif
2011-04-08 00:04:09 +02:00
2013-10-25 11:17:26 -05:00
class MainDialog : public QMainWindow, private Ui::MainWindow
{
Q_OBJECT
2011-04-08 00:04:09 +02:00
2013-10-25 11:17:26 -05:00
public:
2020-11-13 11:39:47 +04:00
explicit MainDialog(QWidget* parent = nullptr);
~MainDialog() override;
FirstRunDialogResult showFirstRunDialog();
bool reloadSettings();
bool writeSettings();
2013-10-25 11:17:26 -05:00
public slots:
void changePage(QListWidgetItem* current, QListWidgetItem* previous);
void play();
void help();
private slots:
void wizardStarted();
void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus);
2013-10-25 11:17:26 -05:00
private:
bool setup();
2013-10-25 11:17:26 -05:00
void createIcons();
void createPages();
2013-10-25 11:17:26 -05:00
bool setupLauncherSettings();
bool setupGameSettings();
bool setupGraphicsSettings();
bool setupGameData();
void setVersionLabel();
2013-10-25 11:17:26 -05:00
void loadSettings();
void saveSettings();
2013-10-25 11:17:26 -05:00
inline bool startProgram(const QString& name, bool detached = false)
{
return startProgram(name, QStringList(), detached);
}
bool startProgram(const QString& name, const QStringList& arguments, bool detached = false);
2011-04-08 00:04:09 +02:00
void closeEvent(QCloseEvent* event) override;
2013-10-25 11:17:26 -05:00
PlayPage* mPlayPage;
GraphicsPage* mGraphicsPage;
DataFilesPage* mDataFilesPage;
2014-01-27 20:14:02 +01:00
SettingsPage* mSettingsPage;
AdvancedPage* mAdvancedPage;
2014-01-27 20:14:02 +01:00
Process::ProcessInvoker* mGameInvoker;
Process::ProcessInvoker* mWizardInvoker;
2013-10-25 11:17:26 -05:00
Files::ConfigurationManager mCfgMgr;
Config::GameSettings mGameSettings;
Config::LauncherSettings mLauncherSettings;
2013-10-25 11:17:26 -05:00
};
}
2011-04-08 00:04:09 +02:00
#endif