Started implementing better MVC support: thanks Petro for the idea! ;)
[emufront] / src / mainwindow.h
1 // EmuFront
2 // Copyright 2010 Mikko Keinänen
3 //
4 // This file is part of EmuFront.
5 //
6 //
7 // EmuFront is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2 as published by
9 // the Free Software Foundation and appearing in the file gpl.txt included in the
10 // packaging of this file.
11 //
12 // EmuFront is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
19
20 #ifndef MAINWINDOW_H
21 #define MAINWINDOW_H
22
23 #include <QMainWindow>
24
25 class QAction;
26 class PlatformDialog;
27 class PlatformMainDialog;
28 class MediaTypeDialog;
29 class MediaImagePathMainDialog;
30 class SetupMainDialog;
31 class ExecutableMainDialog;
32 //class TmpFolderEditDialog;
33 class QLabel;
34 class DatabaseManager;
35 class EmuFrontDialog;
36 class EmuLauncher;
37 class DatFileUtil;
38 class QErrorMessage;
39
40 class MainWindow : public QMainWindow
41 {
42         Q_OBJECT
43
44 public:
45     MainWindow(bool reset = false);
46     //~MainWindow()
47
48 protected:
49         void closeEvent(QCloseEvent *event);
50
51 private slots:
52     void configurePlatforms();
53     void configurePlatformss();
54     void configureMediaTypes();
55     void configureMediaImagePaths();
56     void configureSetups();
57     void configureEmulators();
58     void configureTmpDir();
59     void resetDb();
60     void updateData();
61     void manageDatFiles();
62     void about();
63
64 private:
65     static QString aboutStr;
66     static QString aboutTitle;
67     void createActions();
68         void createMenus();
69         void createStatusBar();
70         void readSettings();
71         void writeSettings();
72         bool okToContinue();
73     void connectSignals();
74     void activateDialog(EmuFrontDialog*) const;
75     bool testDB(bool reset);
76     void createDB() const;
77     PlatformDialog *platformDialog;
78     PlatformMainDialog *plfDialog;
79     MediaTypeDialog *mediaTypeDialog;
80     MediaImagePathMainDialog *mediaImagePathDialog;
81     SetupMainDialog *setupMainDialog;
82     ExecutableMainDialog *executableMainDialog;
83     //TmpFolderEditDialog *tmpFolderDialog;
84         QMenu *configMenu;
85     QMenu *fileMenu;
86     QMenu *helpMenu;
87     QAction *configPlatformAction;
88     QAction *configPlatformsAction;
89     QAction *configMediaTypeAction;
90     QAction *configMediaImagePathAction;
91     QAction *configSetupAction;
92     QAction *configEmulatorAction;
93     QAction *exitAction;
94     QAction *resetDbAction;
95     QAction *aboutAction;
96     QAction *configTmpDirAction;
97     QAction *manageDatFilesAction;
98         QLabel *messageLabel;
99     DatabaseManager *dbManager;
100     EmuLauncher *launcher;
101     QString tmpDirFilePath;
102     QErrorMessage *errorMessage;
103 };
104
105 #endif