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