//
//
// 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.
//
// EmuFront is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <QtGui>
#include "executablemaindialog.h"
#include "executableeditdialog.h"
-#include "../db/dbexecutable.h"
-#include "../dataobjects/executable.h"
+#include "dbexecutable.h"
+#include "executable.h"
ExecutableMainDialog::ExecutableMainDialog(QWidget *parent)
: DbObjectDialog(parent)
dbManager = new DbExecutable(this);
initDataTable();
initEditDialog();
- objectList->hideColumn(DbExecutable::Executable_Id);
- objectList->hideColumn(DbExecutable::Executable_TypeId);
- objectList->hideColumn(DbExecutable::Executable_SetupId);
+ hiddenColumns << DbExecutable::Executable_Id;
+ hiddenColumns << DbExecutable::Executable_TypeId;
+ hiddenColumns << DbExecutable::Executable_SetupId;
+ hideColumns();
connectSignals();
}
{
nameDialog = new ExecutableEditDialog(
this, dynamic_cast<Executable*>(dbObject));
+ connectNameDialogSignals();
}
void ExecutableMainDialog::deleteCurrentObject()
{
- delete dynamic_cast<Executable*>(dbObject);
- dbObject = 0;
+ if (dbObject) {
+ Executable *exe = dynamic_cast<Executable*>(dbObject);
+ if (exe) delete exe;
+ else qDebug() << "Failed deleting Executable";
+ dbObject = 0;
+ }
+}
+
+void ExecutableMainDialog::cleanUp()
+{
+ deleteCurrentObject();
+ if (nameDialog) {
+ ExecutableEditDialog *pnd =
+ dynamic_cast<ExecutableEditDialog *>(nameDialog);
+ if (pnd) delete pnd;
+ else qDebug() << "Failed to delete PlatformNameDialog";
+ nameDialog = 0;
+ }
}
EmuFrontObject* ExecutableMainDialog::createObject()
{
- return new Executable;
+ Executable *ex = new Executable;
+ return ex;
}