#include "emufrontfileobject.h"
-EmuFrontFileObject::EmuFrontFileObject() : EmuFrontObject()
+EmuFrontFileObject::EmuFrontFileObject() : EmuFrontObject(-1, ""), filename(""), filetype(-1)
{ }
EmuFrontFileObject::EmuFrontFileObject(int id, QString name, QString filename)
- : EmuFrontObject(id, name), filename(filename), filetype(0)
+ : EmuFrontObject(id, name), filename(filename), filetype(-1)
{}
EmuFrontFileObject::EmuFrontFileObject(int id, QString name, QString filename, int filetype)
{
dbObject = 0;
dbManager = 0;
+ nameDialog = 0;
editButton = new QPushButton(tr("&Edit"));
editButton->setEnabled(false);
addButton = new QPushButton(tr("&Add"));
void DbObjectDialog::connectSignals()
{
+ qDebug() << "DbObjectDialog connecting signals";
connect(buttonBox, SIGNAL(accepted()), this, SLOT(close()));
connect(objectList, SIGNAL(clicked(const QModelIndex &)),
this, SLOT(listObjectClicked(const QModelIndex &)));
void DbObjectDialog::addObject()
{
+ if (!nameDialog) return;
deleteCurrentObject();
dbObject = createObject();
nameDialog->setDataObject(dbObject);
MediaImagePathDialog::MediaImagePathDialog(QWidget *parent, EmuFrontObject *efObject)
: DataObjectEditDialog(parent, efObject)
{
+ qDebug() << "Creating MediaImagePathDialog";
initWidgets();
populateMediaTypeComBox();
populatePlatformComBox();
MediaImagePathDialog::~MediaImagePathDialog()
{
+ qDebug() << "Destroying MediaImagePathDialog";
}
void MediaImagePathDialog::connectSignals()
{
+ qDebug() << "MediaImagePathDialog Connecting signals";
}
void MediaImagePathDialog::initWidgets()
{
+ qDebug() << "MediaImagePathDialog initializing widgets.";
// these widgets will be automatically parented using layout components
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
filePathLabel = new QLabel;
void MediaImagePathDialog::populateMediaTypeComBox()
{
+ qDebug() << "MediaImagePathDialog populating media types combo box";
dbMediaType = new DbMediaType(this);
mediaTypeComBox->setModel(dbMediaType->getDataModel());
mediaTypeComBox->setModelColumn(DbMediaType::MediaType_Name);
void MediaImagePathDialog::populatePlatformComBox()
{
+ qDebug() << "MediaImagePathDialog populating platform combo box";
dbPlatform = new DbPlatform(this);
platformComBox->setModel(dbPlatform->getDataModel());
platformComBox->setModelColumn(DbPlatform::Platform_Name);
void MediaImagePathDialog::layout()
{
+ qDebug() << "MediaImagePathDialog setting layout";
QLabel *platformLabel = new QLabel(tr("&Platform"));
platformLabel->setBuddy(platformComBox);
QLabel *mediaTypeLabel = new QLabel(tr("Media&Type"));
FilePathObject *fpo = dynamic_cast<FilePathObject*>(ob);
QString fpath = fpo->getName();
filePathLabel->setText(fpath);
- setSelectedPlatform(fpo->getPlatform());
- setSelectedMediaType(fpo->getMediaType());
+ if (fpo->getPlatform()) setSelectedPlatform(fpo->getPlatform());
+ if (fpo->getMediaType()) setSelectedMediaType(fpo->getMediaType());
}
void MediaImagePathDialog::setSelectedPlatform(const Platform *plf)