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