db4e8facbb237c2fca2f6f59ec97dd8f5f06dd2e
[emufront] / src / emulauncher.h
1 /*
2 ** EmuFront
3 ** Copyright 2010 Mikko Keinänen
4 **
5 ** This file is part of EmuFront.
6 **
7 **
8 ** EmuFront is free software: you can redistribute it and/or modify
9 ** it under the terms of the GNU General Public License version 2 as published by
10 ** the Free Software Foundation and appearing in the file gpl.txt included in the
11 ** packaging of this file.
12 **
13 ** EmuFront is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
20 */#ifndef EMULAUNCHER_H
21 #define EMULAUNCHER_H
22
23 #include <QWidget>
24 #include <QProcess>
25
26 class QTableView;
27 class QPushButton;
28 class QComboBox;
29 class QErrorMessage;
30 //class DbMediaType;
31 //class DbPlatform;
32 class DbMediaImageContainer;
33 //class DbExecutable;
34 //class EFFileObjectComboBox;
35 //class ExecutableComboBox;
36 class Executable;
37 class MediaImageContainer;
38 class EmuHelper;
39
40 class EmuLauncher : public QWidget
41 {
42 Q_OBJECT
43 public:
44     EmuLauncher(QErrorMessage *, QWidget *parent = 0, QString tmp = ".");
45     ~EmuLauncher();
46     void updateData();
47     void setTmpDirPath(QString);
48
49 signals:
50
51 private slots:
52     void updateMediaImageContainers();
53     void launchEmu();
54     void processError(QProcess::ProcessError);
55     void processFinished(int);
56
57 private:
58     QTableView *micTable;
59     /*EFFileObjectComboBox *platformSelectBox;
60     EFFileObjectComboBox *mediaTypeSelectBox;
61     ExecutableComboBox *execSelectBox;*/
62     QComboBox *platformSelectBox;
63     QComboBox *mediaTypeSelectBox;
64     QComboBox *execSelectBox;
65
66     QPushButton *selectButton;
67     QPushButton *launchButton;
68     //DbPlatform *dbPlatform;
69     //DbMediaType *dbMediaType;
70     DbMediaImageContainer *dbMic;
71     //DbExecutable *dbExec;
72     EmuHelper *emuHelper;
73     void initWidgets();
74     void layout();
75     void connectSignals();
76     //void populatePlatformSelectBox();
77     //void populateMediaTypeSelectBox();
78     void launch(const Executable*, const MediaImageContainer*);
79     void cleanTmp();
80     QString tmpDirPath;
81     QErrorMessage *errorMessage;
82 };
83
84 #endif // EMULAUNCHER_H