OpenMW
apps/launcher/maindialog.hpp
Go to the documentation of this file.
00001 #ifndef MAINDIALOG_H
00002 #define MAINDIALOG_H
00003 
00004 #include <QMainWindow>
00005 #ifndef Q_MOC_RUN
00006 #include <components/files/configurationmanager.hpp>
00007 #endif
00008 #include "settings/gamesettings.hpp"
00009 #include "settings/graphicssettings.hpp"
00010 #include "settings/launchersettings.hpp"
00011 
00012 #include "ui_mainwindow.h"
00013 
00014 class QListWidgetItem;
00015 
00016 namespace Launcher
00017 {
00018     class PlayPage;
00019     class GraphicsPage;
00020     class DataFilesPage;
00021     class UnshieldThread;
00022 
00023 #ifndef WIN32
00024     bool expansions(Launcher::UnshieldThread& cd);
00025 #endif
00026 
00027     class MainDialog : public QMainWindow, private Ui::MainWindow
00028     {
00029         Q_OBJECT
00030 
00031     public:
00032         explicit MainDialog(QWidget *parent = 0);
00033         bool setup();
00034         bool showFirstRunDialog();
00035 
00036     public slots:
00037         void changePage(QListWidgetItem *current, QListWidgetItem *previous);
00038         void play();
00039 
00040     private:
00041         void createIcons();
00042         void createPages();
00043 
00044         bool setupLauncherSettings();
00045         bool setupGameSettings();
00046         bool setupGraphicsSettings();
00047 
00048         void loadSettings();
00049         void saveSettings();
00050         bool writeSettings();
00051 
00052         inline bool startProgram(const QString &name, bool detached = false) { return startProgram(name, QStringList(), detached); }
00053         bool startProgram(const QString &name, const QStringList &arguments, bool detached = false);
00054 
00055         void closeEvent(QCloseEvent *event);
00056 
00057         PlayPage *mPlayPage;
00058         GraphicsPage *mGraphicsPage;
00059         DataFilesPage *mDataFilesPage;
00060 
00061         Files::ConfigurationManager mCfgMgr;
00062 
00063         GameSettings mGameSettings;
00064         GraphicsSettings mGraphicsSettings;
00065         LauncherSettings mLauncherSettings;
00066 
00067     };
00068 }
00069 #endif