#include "setup.h"
#include "setupmodel.h"
#include "externalexecutablemodel.h"
-//#include "dbmediaimagecontainer.h"
#include "mediaimagecontainer.h"
#include "mediaimagecontainermodel.h"
#include "effileobjectcombobox.h"
#include "emuhelper.h"
#include "emufrontinputdialog.h"
-EmuLauncher::EmuLauncher(QErrorMessage *errorMessage, SetupModel *supModel, QWidget *parent, QString tmp) :
- QWidget(parent), supModel(supModel), tmpDirPath(tmp), errorMessage(errorMessage)
+EmuLauncher::EmuLauncher(QErrorMessage *errorMessage, SetupModel *supModel, ExternalExecutableModel
+ *emuModel, QWidget *parent, QString tmp) :
+ QWidget(parent), supModel(supModel), emuModel(emuModel), tmpDirPath(tmp), errorMessage(errorMessage)
{
emuHelper = new EmuHelper(this);
initWidgets();
qDebug() << "EmuLauncher::updateData";
micModel->refresh();
emuModel->refresh();
- supModel->refresh();
- //setupSelectBox->update();
}
void EmuLauncher::initWidgets()
setupSelectBox->setModel(supModel);
setupSelectBox->setModelColumn(SetupModel::Setup_Name);
- emuModel = new ExternalExecutableModel(this);
+ //emuModel = new ExternalExecutableModel(this);
execSelectBox = new QComboBox(this);
execSelectBox->setModel(emuModel);
execSelectBox->setModelColumn(ExternalExecutableModel::Executable_Name);
class QPushButton;
class QComboBox;
class QErrorMessage;
-//class DbMediaImageContainer;
class Executable;
class MediaImageContainer;
class EmuHelper;
{
Q_OBJECT
public:
- EmuLauncher(QErrorMessage *, SetupModel *supModel, QWidget *parent = 0, QString tmp = ".");
+ EmuLauncher(QErrorMessage *, SetupModel *supModel,
+ ExternalExecutableModel *emuModel,
+ QWidget *parent = 0, QString tmp = ".");
~EmuLauncher();
void updateData();
void setTmpDirPath(QString);
QComboBox *execSelectBox;
QPushButton *selectButton;
QPushButton *launchButton;
- //DbMediaImageContainer *dbMic;
EmuHelper *emuHelper;
void initWidgets();
void layout();
** You should have received a copy of the GNU General Public License
** along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include <QtGui>
#include "mainwindow.h"
#include "emulauncher.h"
// TODO: deprecated
//#include "executablemaindialog.h"
#include "externalexecutableeditview.h"
+#include "externalexecutablemodel.h"
#include "datfileutil.h"
#include "databasemanager.h"
#include "dbcreator.h"
tmpDirFilePath = QDir::homePath();
qDebug() << "Temporary dir is " << tmpDirFilePath;
supModel = new SetupModel(this);
- launcher = new EmuLauncher(errorMessage, supModel, this, tmpDirFilePath);
+ emuModel = new ExternalExecutableModel(this);
+ launcher = new EmuLauncher(errorMessage, supModel, emuModel, this, tmpDirFilePath);
setCentralWidget(launcher);
createActions();
createMenus();
void MainWindow::configureEmulatorss()
{
if (!emulatorEditView) {
- emulatorEditView = new ExternalExecutableEditView(this);
- connect(emulatorEditView, SIGNAL(finished(int)), this, SLOT(updateData()));
+ emulatorEditView = new ExternalExecutableEditView(emuModel, this);
+ //connect(emulatorEditView, SIGNAL(finished(int)), this, SLOT(updateData()));
}
activateDialog(emulatorEditView);
}
-/*
-** EmuFront
+/* ** EmuFront
** Copyright 2010 Mikko Keinänen
**
** This file is part of EmuFront.
**
** You should have received a copy of the GNU General Public License
** along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
-*/#ifndef MAINWINDOW_H
+*/
+
+#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
class DatFileUtil;
class QErrorMessage;
class SetupModel;
+class ExternalExecutableModel;
class MainWindow : public QMainWindow
{
QString tmpDirFilePath;
QErrorMessage *errorMessage;
SetupModel *supModel;
+ ExternalExecutableModel *emuModel;
};
#endif
#include "comboboxdelegate.h"
#include <QtGui>
-ExternalExecutableEditView::ExternalExecutableEditView(QWidget *parent) :
+ExternalExecutableEditView::ExternalExecutableEditView(ExternalExecutableModel *emuModel, QWidget *parent) :
EmuFrontEditView(parent)
{
- model = new ExternalExecutableModel(this);
+ model = emuModel; // new ExternalExecutableModel(this);
objectList->setModel(model);
SetupModel *stupMdl = new SetupModel(this);
ComboBoxDelegate *setupDelegate = new ComboBoxDelegate(
#include "emufronteditview.h"
+class ExternalExecutableModel;
class ExternalExecutableEditView : public EmuFrontEditView
{
Q_OBJECT
public:
- explicit ExternalExecutableEditView(QWidget *parent = 0);
-
-signals:
-
-public slots:
-
+ ExternalExecutableEditView(ExternalExecutableModel *emuModel, QWidget *parent = 0);
};
#endif // EXTERNALEXECUTABLEEDITVIEW_H