PlatformModel and MediaTypeModel instances are shared from MainWindow.
[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
21 #ifndef MAINWINDOW_H
22 #define MAINWINDOW_H
23
24 #include <QMainWindow>
25
26 class QAction;
27 // TODO: DEPRECATED
28 //class PlatformDialog;
29 class PlatformEditView;
30 class MediaTypeEditView;
31 // TODO: DEPRECATED
32 //class MediaTypeDialog;
33 class MediaTypeEditView;
34 // TODO: DEPRECATED
35 //class MediaImagePathMainDialog;
36 class FilePathEditView;
37 // TODO: DEPRECATED
38 //class SetupMainDialog;
39 class SetupEditView;
40 // TODO: DEPRECATED
41 //class ExecutableMainDialog;
42 class ExternalExecutableEditView;
43 //class TmpFolderEditDialog;
44 class QLabel;
45 class DatabaseManager;
46 class EmuFrontDialog;
47 class EmuLauncher;
48 class DatFileUtil;
49 class QErrorMessage;
50 class SetupModel;
51 class ExternalExecutableModel;
52 class PlatformModel;
53 class MediaTypeModel;
54
55 class MainWindow : public QMainWindow
56 {
57         Q_OBJECT
58
59 public:
60     MainWindow(bool reset = false);
61     //~MainWindow()
62
63 protected:
64         void closeEvent(QCloseEvent *event);
65
66 private slots:
67     // TODO: DEPRECATED
68     //void configurePlatforms();
69     void configurePlatformss();
70     // TODO: DEPRECATED
71     //void configureMediaTypes();
72     void configureMediaTypess();
73     // TODO: DEPRECATED
74     //void configureMediaImagePaths();
75     void configureMediaImagePathss();
76     // TODO: DEPRECATED
77     //void configureSetups();
78     void configureSetupss();
79     // TODO: DEPRECATED
80     //void configureEmulators();
81     void configureEmulatorss();
82     void configureTmpDir();
83     void resetDb();
84     void updateData();
85     void manageDatFiles();
86     void about();
87
88 private:
89     static QString aboutStr;
90     static QString aboutTitle;
91     void createActions();
92         void createMenus();
93         void createStatusBar();
94         void readSettings();
95         void writeSettings();
96         bool okToContinue();
97     void connectSignals();
98     void activateDialog(EmuFrontDialog*) const;
99     bool testDB(bool reset);
100     void createDB() const;
101
102     // TODO: deprecated
103     //PlatformDialog *platformDialog;
104     PlatformEditView *plfDialog;
105     // TODO: deprecated
106     //MediaTypeDialog *mediaTypeDialog;
107     MediaTypeEditView *mdtDialog;
108     // TODO: DEPRECATED
109     //MediaImagePathMainDialog *mediaImagePathDialog;
110     FilePathEditView *mediaImagePathView;
111     // TODO: deprecated
112     //SetupMainDialog *setupMainDialog;
113     SetupEditView *setupMainView;
114     // TODO: deprecated
115     //ExecutableMainDialog *executableMainDialog;
116     ExternalExecutableEditView *emulatorEditView;
117     //TmpFolderEditDialog *tmpFolderDialog;
118         QMenu *configMenu;
119     QMenu *fileMenu;
120     QMenu *helpMenu;
121     // TODO: deprecated
122     //QAction *configPlatformAction;
123     QAction *configPlatformsAction;
124     // TODO: deprecated
125     //QAction *configMediaTypeAction;
126     QAction *configMediaTypesAction;
127     // TODO: DEPRECATED
128     //QAction *configMediaImagePathAction;
129     QAction *configMediaImagePathsAction;
130     // TODO: deprecated
131     //QAction *configSetupAction;
132     QAction *configSetupsAction;
133     // TODO: deprecated
134     //QAction *configEmulatorAction;
135     QAction *configEmulatorsAction;
136     QAction *exitAction;
137     QAction *resetDbAction;
138     QAction *aboutAction;
139     QAction *configTmpDirAction;
140     QAction *manageDatFilesAction;
141         QLabel *messageLabel;
142     DatabaseManager *dbManager;
143     EmuLauncher *launcher;
144     QString tmpDirFilePath;
145     QErrorMessage *errorMessage;
146     SetupModel *supModel;
147     ExternalExecutableModel *emuModel;
148     PlatformModel *plfModel;
149     MediaTypeModel *mdtModel;
150 };
151
152 #endif