2 // Copyright 2010 Mikko Keinänen
4 // This file is part of EmuFront.
7 // EmuFront is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // Foobar 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.
17 // You should have received a copy of the GNU General Public License
18 // along with Foobar. If not, see <http://www.gnu.org/licenses/>.
21 #include <QSqlTableModel>
22 #include "../db/dbplatform.h"
23 #include "../db/dbmediatype.h"
24 #include "mediaimagepathdialog.h"
26 MediaImagePathDialog::MediaImagePathDialog(QWidget *parent, EmuFrontObject *efObject)
27 : DataObjectEditDialog(parent, efObject)
30 populateMediaTypeComBox();
31 populatePlatformComBox();
36 void MediaImagePathDialog::connectSignals()
40 void MediaImagePathDialog::initWidgets()
42 // these widgets will be automatically parented using layout components
43 buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
44 filePathLabel = new QLabel;
45 filePathButton = new QPushButton(tr("&Browse filepath"));
46 mediaTypeComBox = new QComboBox;
47 platformComBox = new QComboBox;
50 void MediaImagePathDialog::populateMediaTypeComBox()
54 void MediaImagePathDialog::populatePlatformComBox()
58 void MediaImagePathDialog::layout()
60 QLabel *platformLabel = new QLabel(tr("&Platform"));
61 platformLabel->setBuddy(platformComBox);
62 QLabel *mediaTypeLabel = new QLabel(tr("Media&Type"));
63 mediaTypeLabel->setBuddy(mediaTypeComBox);
65 QGridLayout *gridLayout = new QGridLayout;
66 gridLayout->addWidget(platformLabel, 0, 0);
67 gridLayout->addWidget(platformComBox, 0, 1);
68 gridLayout->addWidget(mediaTypeLabel, 1, 0);
69 gridLayout->addWidget(mediaTypeComBox, 1, 1);
70 gridLayout->addWidget(filePathButton, 2, 0);
71 gridLayout->addWidget(filePathLabel, 2, 1);
72 gridLayout->addWidget(buttonBox, 3, 0, 1, 2);
73 setLayout(gridLayout);
75 setWindowTitle(tr("Set media image paths"));
78 void MediaImagePathDialog::setDataObject(EmuFrontObject *)