3 ** Copyright 2010 Mikko Keinänen
5 ** This file is part of EmuFront.
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.
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.
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/>.
22 #include "dbplatform.h"
24 #include "platformdialog.h"
25 #include "platformnamedialog.h"
27 PlatformDialog::PlatformDialog(QWidget *parent)
28 : EmuFrontFileObjectDialog(parent)
30 setWindowTitle(tr("Set emulated platforms"));
31 dbManager = new DbPlatform(this);
37 // do not move to parent class:
41 PlatformDialog::~PlatformDialog()
43 qDebug() << "PlatformDialog destructor.";
44 deleteCurrentObject();
47 void PlatformDialog::initEditDialog()
49 nameDialog = new PlatformNameDialog(this, dynamic_cast<Platform*>(dbObject));
50 connectNameDialogSignals();
53 EmuFrontObject* PlatformDialog::createObject()
55 qDebug() << "PlatformDialog creating a Platform object.";
59 void PlatformDialog::deleteCurrentObject()
62 qDebug() << "PlatformDialog deleting a Platform object.";
63 Platform *plf = dynamic_cast<Platform*>(dbObject);
65 else qDebug() << "Failed deleting Platform";
70 void PlatformDialog::cleanUp()
72 deleteCurrentObject();
74 PlatformNameDialog *pnd =
75 dynamic_cast<PlatformNameDialog*>(nameDialog);
77 else qDebug() << "Failed to delete PlatformNameDialog";