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 "platformnamedialog.h"
23 #include "databasemanager.h"
25 PlatformNameDialog::PlatformNameDialog(QWidget *parent, Platform *efObj)
26 : NameDialog(parent, efObj)
28 setWindowTitle(tr("Set platform name"));
31 PlatformNameDialog::~PlatformNameDialog()
33 // no need to delete efObject here, the calling widget will take care of it
34 // delete dynamic_cast<Platform*>(efObject);
37 void PlatformNameDialog::setDataObject(QString name)
39 efObject->setName(name);
40 (dynamic_cast<Platform*>(efObject))->setFile(0);
43 void PlatformNameDialog::setDataObject(EmuFrontObject *ob)
47 efObject = dynamic_cast<Platform*>(ob);
48 nameEdit->setText(efObject->getName());
49 nameEdit->setFocus(Qt::TabFocusReason);
53 /*void PlatformNameDialog::keyPressEvent(QKeyEvent *event)
55 nameEdit->setText( nameEdit->text().append(event->text()) );
56 QDialog::keyPressEvent(event);