//
//
// EmuFront is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// it under the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation and appearing in the file gpl.txt included in the
+// packaging of this file.
//
-// Foobar is distributed in the hope that it will be useful,
+// EmuFront is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
-// along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+// along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
#include <QtGui>
#include "namedialog.h"
nameLabel->setBuddy(nameEdit);
connectSignals();
layout();
+ emit test();
setWindowTitle(tr("Set names"));
}
setLayout(mainLayout);
}
-void NameDialog::rejectChanges()
-{
- efObject = 0;
- emit updateRejected();
- close();
-}
-
void NameDialog::acceptChanges()
{
if (nameEdit->text() == 0 || nameEdit->text().trimmed().isEmpty())
}
QString name = nameEdit->text().simplified();
- setDataObject(name);
- emit dataObjectUpdated();
+ qDebug() << "We have a name " << name << ".";
+ if (name != efObject->getName()) {
+ setDataObject(name);
+ emit dataObjectUpdated();
+ }
+ qDebug() << "Signal emitted.";
efObject = 0; // TODO we should also set efObject to null when user clicks abort
close();
}
void NameDialog::setDataObject(EmuFrontObject *ob)
{
if (!ob) return;
- // delete efObject; -> we should not delete the previously referenced data object here, it may be still used in the parent widget
- // the parent widget will take of destruction
+ // delete efObject; -> we should not delete the previously referenced data object here, it
+ // may be still used in the parent widget
+ // the parent widget will take care of destruction
// we'll just refresh the name dialog pointer to a new object
efObject = ob;
}
+
+void NameDialog::clear()
+{
+ nameEdit->clear();
+}