Added database version field to config db table. Added db
[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(bool reset = false);
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     bool testDB(bool reset);
72         PlatformDialog *platformDialog;
73     MediaTypeDialog *mediaTypeDialog;
74     MediaImagePathMainDialog *mediaImagePathDialog;
75     SetupMainDialog *setupMainDialog;
76     ExecutableMainDialog *executableMainDialog;
77     //TmpFolderEditDialog *tmpFolderDialog;
78         QMenu *configMenu;
79     QMenu *fileMenu;
80     QMenu *helpMenu;
81     QAction *configPlatformAction;
82     QAction *configMediaTypeAction;
83     QAction *configMediaImagePathAction;
84     QAction *configSetupAction;
85     QAction *configEmulatorAction;
86     QAction *exitAction;
87     QAction *aboutAction;
88     QAction *configTmpDirAction;
89     QAction *manageDatFilesAction;
90         QLabel *messageLabel;
91     DatabaseManager *dbManager;
92     EmuLauncher *launcher;
93     QString tmpDirFilePath;
94 };
95
96 #endif