OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
maindialog.hpp
Go to the documentation of this file.
1 #ifndef MAINDIALOG_H
2 #define MAINDIALOG_H
3 
4 #include <QMainWindow>
5 #include <QProcess>
6 
7 #ifndef Q_MOC_RUN
9 #endif
10 
12 
15 
17 
18 #include "ui_mainwindow.h"
19 
20 class QListWidgetItem;
21 class QStackedWidget;
22 class QStringList;
23 class QStringListModel;
24 class QString;
25 
26 namespace Launcher
27 {
28  class PlayPage;
29  class GraphicsPage;
30  class DataFilesPage;
31  class UnshieldThread;
32  class SettingsPage;
33 
35  {
39  };
40 
41 #ifndef WIN32
42  bool expansions(Launcher::UnshieldThread& cd);
43 #endif
44 
45  class MainDialog : public QMainWindow, private Ui::MainWindow
46  {
47  Q_OBJECT
48 
49  public:
50  explicit MainDialog(QWidget *parent = 0);
51  ~MainDialog();
52 
54 
55  bool reloadSettings();
56  bool writeSettings();
57 
58  public slots:
59  void changePage(QListWidgetItem *current, QListWidgetItem *previous);
60  void play();
61 
62  private slots:
63  void wizardStarted();
64  void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus);
65 
66  private:
67  bool setup();
68 
69  void createIcons();
70  void createPages();
71 
72  bool setupLauncherSettings();
73  bool setupGameSettings();
74  bool setupGraphicsSettings();
75 
76  void setVersionLabel();
77 
78  void loadSettings();
79  void saveSettings();
80 
81  inline bool startProgram(const QString &name, bool detached = false) { return startProgram(name, QStringList(), detached); }
82  bool startProgram(const QString &name, const QStringList &arguments, bool detached = false);
83 
84  void closeEvent(QCloseEvent *event);
85 
90 
93 
95 
99 
100  };
101 }
102 #endif
Definition: playpage.hpp:14
Definition: settingspage.hpp:21
Config::LauncherSettings mLauncherSettings
Definition: maindialog.hpp:98
void play()
Definition: maindialog.cpp:565
bool setupGraphicsSettings()
Definition: maindialog.cpp:386
DataFilesPage * mDataFilesPage
Definition: maindialog.hpp:88
Process::ProcessInvoker * mGameInvoker
Definition: maindialog.hpp:91
bool setup()
Definition: maindialog.cpp:199
FirstRunDialogResult
Definition: maindialog.hpp:34
PlayPage * mPlayPage
Definition: maindialog.hpp:86
void wizardStarted()
Definition: maindialog.cpp:548
Definition: maindialog.hpp:36
FirstRunDialogResult showFirstRunDialog()
Definition: maindialog.cpp:140
Definition: configurationmanager.hpp:20
void createPages()
Definition: maindialog.cpp:113
Process::ProcessInvoker * mWizardInvoker
Definition: maindialog.hpp:92
GraphicsPage * mGraphicsPage
Definition: maindialog.hpp:87
bool setupGameSettings()
Definition: maindialog.cpp:292
Definition: maindialog.hpp:45
Definition: processinvoker.hpp:10
Files::ConfigurationManager mCfgMgr
Definition: maindialog.hpp:94
Settings::Manager mEngineSettings
Definition: maindialog.hpp:97
Definition: maindialog.hpp:38
Config::GameSettings mGameSettings
Definition: maindialog.hpp:96
Definition: graphicspage.hpp:16
Definition: datafilespage.hpp:25
SettingsPage * mSettingsPage
Definition: maindialog.hpp:89
~MainDialog()
Definition: maindialog.cpp:72
bool expansions(Launcher::UnshieldThread &cd)
Definition: launchersettings.hpp:9
void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus)
Definition: maindialog.cpp:553
void setVersionLabel()
Definition: maindialog.cpp:178
bool startProgram(const QString &name, bool detached=false)
Definition: maindialog.hpp:81
MainDialog(QWidget *parent=0)
Definition: maindialog.cpp:36
void loadSettings()
Definition: maindialog.cpp:441
bool setupLauncherSettings()
Definition: maindialog.cpp:258
void closeEvent(QCloseEvent *event)
Definition: maindialog.cpp:542
Settings management (can change during runtime)
Definition: settings.hpp:17
Definition: maindialog.hpp:37
void createIcons()
Definition: maindialog.cpp:78
bool writeSettings()
Definition: maindialog.cpp:471
void saveSettings()
Definition: maindialog.cpp:453
bool reloadSettings()
Definition: maindialog.cpp:223
void changePage(QListWidgetItem *current, QListWidgetItem *previous)
Definition: maindialog.cpp:248
Definition: gamesettings.hpp:20
const char * name
Definition: crashcatcher.cpp:59