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