2011-04-07 22:04:09 +00:00
|
|
|
#ifndef MAINDIALOG_H
|
|
|
|
#define MAINDIALOG_H
|
|
|
|
|
2012-06-20 00:28:49 +00:00
|
|
|
#include <QMainWindow>
|
2013-04-02 19:32:23 +00:00
|
|
|
#ifndef Q_MOC_RUN
|
2012-01-21 00:14:35 +00:00
|
|
|
#include <components/files/configurationmanager.hpp>
|
2013-04-02 19:32:23 +00:00
|
|
|
#endif
|
2013-02-20 18:27:04 +00:00
|
|
|
#include "settings/gamesettings.hpp"
|
|
|
|
#include "settings/graphicssettings.hpp"
|
|
|
|
#include "settings/launchersettings.hpp"
|
|
|
|
|
2013-03-02 23:48:09 +00:00
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
class QListWidget;
|
|
|
|
class QListWidgetItem;
|
|
|
|
class QStackedWidget;
|
2011-09-06 01:50:40 +00:00
|
|
|
class QStringList;
|
2011-04-07 22:04:09 +00:00
|
|
|
class QStringListModel;
|
2011-09-06 01:50:40 +00:00
|
|
|
class QString;
|
2011-04-07 22:04:09 +00:00
|
|
|
|
|
|
|
class PlayPage;
|
2011-05-02 20:21:42 +00:00
|
|
|
class GraphicsPage;
|
2011-04-07 22:04:09 +00:00
|
|
|
class DataFilesPage;
|
|
|
|
|
2013-03-02 23:48:09 +00:00
|
|
|
class MainDialog : public QMainWindow, private Ui::MainWindow
|
2011-04-07 22:04:09 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-02-20 18:27:04 +00:00
|
|
|
MainDialog();
|
2013-02-11 14:01:00 +00:00
|
|
|
bool setup();
|
2013-02-20 18:27:04 +00:00
|
|
|
bool showFirstRunDialog();
|
2011-04-07 22:04:09 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
|
2011-04-24 21:03:21 +00:00
|
|
|
void play();
|
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
private:
|
|
|
|
void createIcons();
|
2011-05-02 20:21:42 +00:00
|
|
|
void createPages();
|
2013-02-11 14:01:00 +00:00
|
|
|
|
2013-02-20 18:27:04 +00:00
|
|
|
bool setupLauncherSettings();
|
|
|
|
bool setupGameSettings();
|
|
|
|
bool setupGraphicsSettings();
|
|
|
|
|
2013-02-11 14:01:00 +00:00
|
|
|
void loadSettings();
|
|
|
|
void saveSettings();
|
2013-03-10 20:12:26 +00:00
|
|
|
bool writeSettings();
|
2013-02-11 14:01:00 +00:00
|
|
|
|
2013-02-20 18:27:04 +00: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-24 21:03:21 +00:00
|
|
|
void closeEvent(QCloseEvent *event);
|
2011-04-07 22:04:09 +00:00
|
|
|
|
|
|
|
PlayPage *mPlayPage;
|
2011-05-02 20:21:42 +00:00
|
|
|
GraphicsPage *mGraphicsPage;
|
2011-04-07 22:04:09 +00:00
|
|
|
DataFilesPage *mDataFilesPage;
|
2011-05-02 20:21:42 +00:00
|
|
|
|
2012-01-21 00:14:35 +00:00
|
|
|
Files::ConfigurationManager mCfgMgr;
|
2013-01-27 15:39:51 +00:00
|
|
|
|
2013-02-20 18:27:04 +00:00
|
|
|
GameSettings mGameSettings;
|
|
|
|
GraphicsSettings mGraphicsSettings;
|
|
|
|
LauncherSettings mLauncherSettings;
|
2013-01-27 15:39:51 +00:00
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|