Experimenting with reading XML dat files.
[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 class PlatformDialog;
27 class MediaTypeDialog;
28 class MediaImagePathMainDialog;
29 class SetupMainDialog;
30 class ExecutableMainDialog;
31 //class TmpFolderEditDialog;
32 class QLabel;
33 class DatabaseManager;
34 class EmuFrontDialog;
35 class EmuLauncher;
36 class DatFileUtil;
37
38 class MainWindow : public QMainWindow
39 {
40         Q_OBJECT
41
42 public:
43         MainWindow();
44     //~MainWindow()
45
46 protected:
47         void closeEvent(QCloseEvent *event);
48
49 private slots:
50         void configurePlatforms();
51     void configureMediaTypes();
52     void configureMediaImagePaths();
53     void configureSetups();
54     void configureEmulators();
55     void configureTmpDir();
56     void updateData();
57     void manageDatFiles();
58     void about();
59
60 private:
61     static QString aboutStr;
62     static QString aboutTitle;
63     void createActions();
64         void createMenus();
65         void createStatusBar();
66         void readSettings();
67         void writeSettings();
68         bool okToContinue();
69     void connectSignals();
70     void activateDialog(EmuFrontDialog*) const;
71         PlatformDialog *platformDialog;
72     MediaTypeDialog *mediaTypeDialog;
73     MediaImagePathMainDialog *mediaImagePathDialog;
74     SetupMainDialog *setupMainDialog;
75     ExecutableMainDialog *executableMainDialog;
76     //TmpFolderEditDialog *tmpFolderDialog;
77         QMenu *configMenu;
78     QMenu *fileMenu;
79     QMenu *helpMenu;
80     QAction *configPlatformAction;
81     QAction *configMediaTypeAction;
82     QAction *configMediaImagePathAction;
83     QAction *configSetupAction;
84     QAction *configEmulatorAction;
85     QAction *exitAction;
86     QAction *aboutAction;
87     QAction *configTmpDirAction;
88     QAction *manageDatFilesAction;
89         QLabel *messageLabel;
90     DatabaseManager *dbManager;
91     EmuLauncher *launcher;
92     QString tmpDirFilePath;
93 };
94
95 #endif