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