From e2f61dd06139529ec8f3c82181fcf13187487c03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mikko=20Kein=C3=A4nen?= Date: Thu, 30 Sep 2010 18:42:24 +0300 Subject: [PATCH] Populating the platform selector. --- src/emulauncher.cpp | 18 ++++++++++++++++-- src/emulauncher.h | 4 ++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/emulauncher.cpp b/src/emulauncher.cpp index 24afb36..815e9e0 100644 --- a/src/emulauncher.cpp +++ b/src/emulauncher.cpp @@ -18,11 +18,16 @@ // along with EmuFront. If not, see . #include +#include #include "emulauncher.h" +#include "db/dbmediatype.h" +#include "db/dbplatform.h" EmuLauncher::EmuLauncher(QWidget *parent) : QWidget(parent) { + dbPlatform = 0; + dbMediaType = 0; initWidgets(); layout(); //connectSignals(); @@ -35,7 +40,7 @@ void EmuLauncher::initWidgets() platformSelectBox = new QComboBox; selectButton = new QPushButton(tr("&Update")); //populateMediaTypeSelectBox(); - //populatePlatformSelectBox(); + populatePlatformSelectBox(); } void EmuLauncher::layout() @@ -55,12 +60,21 @@ void EmuLauncher::connectSignals() void EmuLauncher::populateMediaTypeSelectBox() { -} + } void EmuLauncher::populatePlatformSelectBox() { + if (!dbPlatform) + + dbPlatform = new DbPlatform(this); + QSqlQueryModel *model = dbPlatform->getDataModel(); + if (!model) + return; + platformSelectBox->setModel(model); + platformSelectBox->setModelColumn(DbPlatform::EmuFrontFileObject_Name); } + void EmuLauncher::updateMediaImageContainers() { } diff --git a/src/emulauncher.h b/src/emulauncher.h index b51f711..4e1d635 100644 --- a/src/emulauncher.h +++ b/src/emulauncher.h @@ -25,6 +25,8 @@ class QTableView; class QComboBox; class QPushButton; +class DbMediaType; +class DbPlatform; class EmuLauncher : public QWidget { @@ -42,6 +44,8 @@ private: QComboBox *platformSelectBox; QComboBox *mediaTypeSelectBox; QPushButton *selectButton; + DbPlatform *dbPlatform; + DbMediaType *dbMediaType; void initWidgets(); void layout(); void connectSignals(); -- 1.7.9.5