Added a skeleton implementation for editing media image file paths.
[emufront] / src / dialogs / mediaimagepathdialog.cpp
1 // EmuFront
2 // Copyright 2010 Mikko Keinänen
3 //
4 // This file is part of EmuFront.
5 //
6 //
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.
11 //
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.
16 //
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/>.
19
20 #include <QtGui>
21 #include <QSqlTableModel>
22 #include "../db/dbplatform.h"
23 #include "../db/dbmediatype.h"
24 #include "mediaimagepathdialog.h"
25
26 MediaImagePathDialog::MediaImagePathDialog(QWidget *parent, EmuFrontObject *efObject)
27     : DataObjectEditDialog(parent, efObject)
28 {
29     initWidgets();
30     populateMediaTypeComBox();
31     populatePlatformComBox();
32     layout();
33     connectSignals();
34 }
35
36 void MediaImagePathDialog::connectSignals()
37 {
38 }
39
40 void MediaImagePathDialog::initWidgets()
41 {
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;
48 }
49
50 void MediaImagePathDialog::populateMediaTypeComBox()
51 {
52 }
53
54 void MediaImagePathDialog::populatePlatformComBox()
55 {
56 }
57
58 void MediaImagePathDialog::layout()
59 {
60    QLabel *platformLabel = new QLabel(tr("&Platform"));
61    platformLabel->setBuddy(platformComBox);
62    QLabel *mediaTypeLabel = new QLabel(tr("Media&Type"));
63    mediaTypeLabel->setBuddy(mediaTypeComBox);
64
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);
74
75    setWindowTitle(tr("Set media image paths"));
76 }
77
78 void MediaImagePathDialog::setDataObject(EmuFrontObject *)
79 {
80 }