From 78e322d80f485f09842e2d8264ca2c39f092eb57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mikko=20Kein=C3=A4nen?= Date: Thu, 7 Oct 2010 22:34:58 +0300 Subject: [PATCH] Added emulator combo box and launcher button. --- src/emulauncher.cpp | 13 +++++++++++++ src/emulauncher.h | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/emulauncher.cpp b/src/emulauncher.cpp index 327615d..9073691 100644 --- a/src/emulauncher.cpp +++ b/src/emulauncher.cpp @@ -22,14 +22,17 @@ #include "emulauncher.h" #include "db/dbmediatype.h" #include "db/dbplatform.h" +#include "db/dbexecutable.h" #include "db/dbmediaimagecontainer.h" #include "widgets/effileobjectcombobox.h" +#include "widgets/executablecombobox.h" EmuLauncher::EmuLauncher(QWidget *parent) : QWidget(parent) { dbPlatform = new DbPlatform(this); dbMediaType = new DbMediaType(this); + dbExec = new DbExecutable(this); dbMic = 0; initWidgets(); layout(); @@ -40,6 +43,7 @@ void EmuLauncher::updateData() { platformSelectBox->updateDataModel(); mediaTypeSelectBox->updateDataModel(); + execSelectBox->updateDataModel(); } void EmuLauncher::initWidgets() @@ -48,7 +52,9 @@ void EmuLauncher::initWidgets() micTable->setSelectionMode(QAbstractItemView::SingleSelection); mediaTypeSelectBox = new EFFileObjectComboBox(dbMediaType, this); platformSelectBox = new EFFileObjectComboBox(dbPlatform, this); + execSelectBox = new ExecutableComboBox(dbExec, this); selectButton = new QPushButton(tr("&Update")); + launchButton = new QPushButton(tr("&Launch")); } void EmuLauncher::layout() @@ -58,12 +64,15 @@ void EmuLauncher::layout() grid->addWidget(mediaTypeSelectBox, 1, 0); grid->addWidget(selectButton, 1, 1); grid->addWidget(micTable, 2, 0, 1, 2); + grid->addWidget(execSelectBox, 3, 0); + grid->addWidget(launchButton, 3, 1); setLayout(grid); } void EmuLauncher::connectSignals() { connect(selectButton, SIGNAL(clicked()), this, SLOT(updateMediaImageContainers())); + connect(launchButton, SIGNAL(clicked()),this, SLOT(launchEmu())); } void EmuLauncher::updateMediaImageContainers() @@ -84,3 +93,7 @@ void EmuLauncher::updateMediaImageContainers() mediaTypeSelectBox->updateDataModel(); } +void EmuLauncher::launchEmu() +{ + qDebug() << "launchEmu"; +} diff --git a/src/emulauncher.h b/src/emulauncher.h index 9983c00..57a5e18 100644 --- a/src/emulauncher.h +++ b/src/emulauncher.h @@ -23,12 +23,13 @@ #include class QTableView; -class QComboBox; class QPushButton; class DbMediaType; class DbPlatform; class DbMediaImageContainer; +class DbExecutable; class EFFileObjectComboBox; +class ExecutableComboBox; class EmuLauncher : public QWidget { @@ -41,15 +42,19 @@ signals: private slots: void updateMediaImageContainers(); + void launchEmu(); private: QTableView *micTable; EFFileObjectComboBox *platformSelectBox; EFFileObjectComboBox *mediaTypeSelectBox; + ExecutableComboBox *execSelectBox; QPushButton *selectButton; + QPushButton *launchButton; DbPlatform *dbPlatform; DbMediaType *dbMediaType; DbMediaImageContainer *dbMic; + DbExecutable *dbExec; void initWidgets(); void layout(); void connectSignals(); -- 1.7.9.5