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

70 lines
1.6 KiB
C++
Raw Normal View History

2011-04-08 00:04:09 +02:00
#ifndef MAINDIALOG_H
#define MAINDIALOG_H
#include <QMainWindow>
#ifndef Q_MOC_RUN
#include <components/files/configurationmanager.hpp>
#endif
#include "settings/gamesettings.hpp"
#include "settings/graphicssettings.hpp"
#include "settings/launchersettings.hpp"
#include "ui_mainwindow.h"
2011-04-08 00:04:09 +02:00
class QListWidgetItem;
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;
#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:
explicit MainDialog(QWidget *parent = 0);
bool setup();
bool showFirstRunDialog();
2013-10-25 11:17:26 -05:00
public slots:
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
void play();
2013-10-25 11:17:26 -05:00
private:
void createIcons();
void createPages();
2013-10-25 11:17:26 -05:00
bool setupLauncherSettings();
bool setupGameSettings();
bool setupGraphicsSettings();
2013-10-25 11:17:26 -05:00
void loadSettings();
void saveSettings();
bool writeSettings();
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
2013-10-25 11:17:26 -05:00
void closeEvent(QCloseEvent *event);
2013-10-25 11:17:26 -05:00
PlayPage *mPlayPage;
GraphicsPage *mGraphicsPage;
DataFilesPage *mDataFilesPage;
2013-10-25 11:17:26 -05:00
Files::ConfigurationManager mCfgMgr;
2013-10-25 11:17:26 -05:00
GameSettings mGameSettings;
GraphicsSettings mGraphicsSettings;
LauncherSettings mLauncherSettings;
2011-04-08 00:04:09 +02:00
2013-10-25 11:17:26 -05:00
};
}
2011-04-08 00:04:09 +02:00
#endif