Refactoring the project, new folders for view and model classes. Added
[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 // TODO: DEPRECATED
27 class PlatformDialog;
28 class PlatformEditView;
29 class MediaTypeEditView;
30 // TODO: DEPRECATED
31 class MediaTypeDialog;
32 class MediaTypeEditView;
33 class MediaImagePathMainDialog;
34 // TODO: DEPRECATED
35 class SetupMainDialog;
36 class SetupEditView;
37 class ExecutableMainDialog;
38 //class TmpFolderEditDialog;
39 class QLabel;
40 class DatabaseManager;
41 class EmuFrontDialog;
42 class EmuLauncher;
43 class DatFileUtil;
44 class QErrorMessage;
45
46 class MainWindow : public QMainWindow
47 {
48         Q_OBJECT
49
50 public:
51     MainWindow(bool reset = false);
52     //~MainWindow()
53
54 protected:
55         void closeEvent(QCloseEvent *event);
56
57 private slots:
58     // TODO: DEPRECATED
59     void configurePlatforms();
60     void configurePlatformss();
61     // TODO: DEPRECATED
62     void configureMediaTypes();
63     void configureMediaTypess();
64     void configureMediaImagePaths();
65     // TODO: DEPRECATED
66     void configureSetups();
67     void configureSetupss();
68     void configureEmulators();
69     void configureTmpDir();
70     void resetDb();
71     void updateData();
72     void manageDatFiles();
73     void about();
74
75 private:
76     static QString aboutStr;
77     static QString aboutTitle;
78     void createActions();
79         void createMenus();
80         void createStatusBar();
81         void readSettings();
82         void writeSettings();
83         bool okToContinue();
84     void connectSignals();
85     void activateDialog(EmuFrontDialog*) const;
86     bool testDB(bool reset);
87     void createDB() const;
88
89     // TODO: deprecated
90     PlatformDialog *platformDialog;
91     PlatformEditView *plfDialog;
92     // TODO: deprecated
93     MediaTypeDialog *mediaTypeDialog;
94     MediaTypeEditView *mdtDialog;
95     MediaImagePathMainDialog *mediaImagePathDialog;
96     // TODO: deprecated
97     SetupMainDialog *setupMainDialog;
98     SetupEditView *setupMainView;
99     ExecutableMainDialog *executableMainDialog;
100     //TmpFolderEditDialog *tmpFolderDialog;
101         QMenu *configMenu;
102     QMenu *fileMenu;
103     QMenu *helpMenu;
104     // TODO: deprecated
105     QAction *configPlatformAction;
106     QAction *configPlatformsAction;
107     // TODO: deprecated
108     QAction *configMediaTypeAction;
109     QAction *configMediaTypesAction;
110     QAction *configMediaImagePathAction;
111     // TODO: deprecated
112     QAction *configSetupAction;
113     QAction *configSetupsAction;
114     QAction *configEmulatorAction;
115     QAction *exitAction;
116     QAction *resetDbAction;
117     QAction *aboutAction;
118     QAction *configTmpDirAction;
119     QAction *manageDatFilesAction;
120         QLabel *messageLabel;
121     DatabaseManager *dbManager;
122     EmuLauncher *launcher;
123     QString tmpDirFilePath;
124     QErrorMessage *errorMessage;
125 };
126
127 #endif