Added window titles.
[emufront] / src / views / setupeditview.cpp
1 /*
2 ** EmuFront
3 ** Copyright 2010 Mikko Keinänen
4 **
5 ** This file is part of EmuFront.
6 **
7 **
8 ** EmuFront is free software: you can redistribute it and/or modify
9 ** it under the terms of the GNU General Public License version 2 as published by
10 ** the Free Software Foundation and appearing in the file gpl.txt included in the
11 ** packaging of this file.
12 **
13 ** EmuFront is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
20 */
21 #include <QtGui>
22 #include "setupeditview.h"
23 #include "setupmodel.h"
24 #include "comboboxdelegate.h"
25 #include "stringlistdelegate.h"
26 #include "platformmodel.h"
27 #include "mediatypemodel.h"
28 #include <QSqlTableModel>
29
30 SetupEditView::SetupEditView(SetupModel *supModel, QWidget *parent) :
31     EmuFrontEditView(parent)//, model(supModel)
32 {
33     setWindowTitle(tr("Setups"));
34     model = supModel;
35     //model = new SetupModel(this);
36     objectList->setModel(model);
37     PlatformModel *plfModel = new PlatformModel(this);
38     ComboBoxDelegate *platformDelegate = new ComboBoxDelegate(
39             plfModel,
40             PlatformModel::EmuFrontFileObject_Id,
41             PlatformModel::EmuFrontFileObject_Name,
42             this
43         );
44     objectList->setItemDelegateForColumn(SetupModel::Setup_PlatformId, platformDelegate);
45     MediaTypeModel *mdtModel = new MediaTypeModel(this);
46     ComboBoxDelegate *mediatypeDelegate = new ComboBoxDelegate(
47             mdtModel,
48             MediaTypeModel::EmuFrontFileObject_Id,
49             MediaTypeModel::EmuFrontFileObject_Name,
50             this
51         );
52     objectList->setItemDelegateForColumn(SetupModel::Setup_MediaTypeId, mediatypeDelegate);
53
54     StringListDelegate *fileTypeDelegate = new StringListDelegate(SetupModel::FILE_TYPE_EXTENSION_SEPARATOR, this);
55     objectList->setItemDelegateForColumn(SetupModel::Setup_FileTypeExtensions, fileTypeDelegate);
56     postInit();
57 }