--- /dev/null
+// EmuFront
+// Copyright 2010 Mikko Keinänen
+//
+// This file is part of EmuFront.
+//
+//
+// EmuFront is free software: you can redistribute it and/or modify
+// 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
+// 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 EmuFront. If not, see <http://www.gnu.org/licenses/>.
+
+#include "mediatypemodel.h"
+
+MediaTypeModel::MediaTypeModel(QObject *parent) :
+ EmuFrontFileObjectModel(parent)
+{
+ tableName = "mediatype";
+ refresh();
+}
--- /dev/null
+// EmuFront
+// Copyright 2010 Mikko Keinänen
+//
+// This file is part of EmuFront.
+//
+//
+// EmuFront is free software: you can redistribute it and/or modify
+// 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
+// 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 EmuFront. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef MEDIATYPEMODEL_H
+#define MEDIATYPEMODEL_H
+
+#include "emufrontfileobjectmodel.h"
+
+class MediaTypeModel : public EmuFrontFileObjectModel
+{
+ Q_OBJECT
+public:
+ MediaTypeModel(QObject *parent = 0);
+};
+
+#endif // MEDIATYPEMODEL_H
--- /dev/null
+// EmuFront
+// Copyright 2010 Mikko Keinänen
+//
+// This file is part of EmuFront.
+//
+//
+// EmuFront is free software: you can redistribute it and/or modify
+// 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
+// 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 EmuFront. If not, see <http://www.gnu.org/licenses/>.
+
+#include "emufrontfileobjectmaindialog.h"
+#include "db/emufrontfileobjectmodel.h"
+
+EmuFrontFileObjectMainDialog::EmuFrontFileObjectMainDialog(QWidget *parent) :
+ EmuFrontDataDialog(parent)
+{
+}
+
+void EmuFrontFileObjectMainDialog::setHiddenColumns()
+{
+ hiddenColumns << EmuFrontFileObjectModel::EmuFrontFileObject_Id;
+ hiddenColumns << EmuFrontFileObjectModel::EmuFrontFileObject_FileId;
+ hiddenColumns << EmuFrontFileObjectModel::EmuFrontFileObject_FileType;
+ hiddenColumns << EmuFrontFileObjectModel::EmuFrontFileObject_FileCheckSum;
+}
--- /dev/null
+// EmuFront
+// Copyright 2010 Mikko Keinänen
+//
+// This file is part of EmuFront.
+//
+//
+// EmuFront is free software: you can redistribute it and/or modify
+// 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
+// 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 EmuFront. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef EMUFRONTFILEOBJECTMAINDIALOG_H
+#define EMUFRONTFILEOBJECTMAINDIALOG_H
+
+#include "emufrontdatadialog.h"
+
+class EmuFrontFileObjectMainDialog : public EmuFrontDataDialog
+{
+ Q_OBJECT
+public:
+ EmuFrontFileObjectMainDialog(QWidget *parent = 0);
+
+private:
+ virtual void setHiddenColumns();
+};
+
+#endif // EMUFRONTFILEOBJECTMAINDIALOG_H
--- /dev/null
+// EmuFront
+// Copyright 2010 Mikko Keinänen
+//
+// This file is part of EmuFront.
+//
+//
+// EmuFront is free software: you can redistribute it and/or modify
+// 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
+// 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 EmuFront. If not, see <http://www.gnu.org/licenses/>.
+
+#include <QtGui>
+#include "mediatypemaindialog.h"
+#include "db/mediatypemodel.h"
+
+MediaTypeMainDialog::MediaTypeMainDialog(QWidget *parent) :
+ EmuFrontFileObjectMainDialog(parent)
+{
+ model = new MediaTypeModel(this);
+ objectList->setModel(model);
+ postInit();
+}
--- /dev/null
+// EmuFront
+// Copyright 2010 Mikko Keinänen
+//
+// This file is part of EmuFront.
+//
+//
+// EmuFront is free software: you can redistribute it and/or modify
+// 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
+// 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 EmuFront. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef MEDIATYPEMAINDIALOG_H
+#define MEDIATYPEMAINDIALOG_H
+
+#include "emufrontfileobjectmaindialog.h"
+
+class MediaTypeMainDialog : public EmuFrontFileObjectMainDialog
+{
+ Q_OBJECT
+public:
+ MediaTypeMainDialog(QWidget *parent = 0);
+};
+
+#endif // MEDIATYPEMAINDIALOG_H
#include "db/platformmodel.h"
PlatformMainDialog::PlatformMainDialog(QWidget *parent) :
- EmuFrontDataDialog(parent)
+ EmuFrontFileObjectMainDialog(parent)
{
model = new PlatformModel(this);
objectList->setModel(model);
postInit();
}
-void PlatformMainDialog::setHiddenColumns()
-{
- hiddenColumns << PlatformModel::EmuFrontFileObject_Id;
- hiddenColumns << PlatformModel::EmuFrontFileObject_FileId;
- hiddenColumns << PlatformModel::EmuFrontFileObject_FileType;
- hiddenColumns << PlatformModel::EmuFrontFileObject_FileCheckSum;
-}
+
#ifndef PLATFORMMAINDIALOG_H
#define PLATFORMMAINDIALOG_H
-#include "emufrontdatadialog.h"
+#include "emufrontfileobjectmaindialog.h"
-
-class PlatformMainDialog : public EmuFrontDataDialog
+class PlatformMainDialog : public EmuFrontFileObjectMainDialog
{
Q_OBJECT
public:
PlatformMainDialog(QWidget *parent = 0);
-private:
- virtual void setHiddenColumns();
-
};
#endif // PLATFORMMAINDIALOG_H
dialogs/platformmaindialog.h \
dialogs/emufrontdatadialog.h \
db/emufrontquerymodel.h \
- db/emufrontfileobjectmodel.h
+ db/emufrontfileobjectmodel.h \
+ db/mediatypemodel.h \
+ dialogs/emufrontfileobjectmaindialog.h \
+ dialogs/mediatypemaindialog.h
SOURCES += main.cpp \
mainwindow.cpp \
db/databasemanager.cpp \
dialogs/platformmaindialog.cpp \
dialogs/emufrontdatadialog.cpp \
db/emufrontquerymodel.cpp \
- db/emufrontfileobjectmodel.cpp
+ db/emufrontfileobjectmodel.cpp \
+ db/mediatypemodel.cpp \
+ dialogs/emufrontfileobjectmaindialog.cpp \
+ dialogs/mediatypemaindialog.cpp
OTHER_FILES +=
CONFIG += mobility
#include <QtGui>
#include "mainwindow.h"
#include "emulauncher.h"
+// TODO: deprecated
#include "dialogs/platformdialog.h"
#include "dialogs/platformmaindialog.h"
#include "dialogs/mediatypedialog.h"
+// TODO: deprecated
+#include "dialogs/mediatypemaindialog.h"
#include "dialogs/mediaimagepathmaindialog.h"
#include "dialogs/setupmaindialog.h"
#include "dialogs/executablemaindialog.h"
createMenus();
createStatusBar();
readSettings();
+ // TODO: deprecated
platformDialog = 0;
+ plfDialog = 0;
+ // TODO: deprecated
mediaTypeDialog = 0;
+ mdtDialog = 0;
mediaImagePathDialog = 0;
setupMainDialog = 0;
executableMainDialog = 0;
void MainWindow::createActions()
{
+ // TODO: deprecated
configPlatformAction = new QAction(tr("&Platforms"), this);
configPlatformAction->setStatusTip(tr("Configure platforms"));
connect(configPlatformAction, SIGNAL(triggered()),
connect(configPlatformsAction, SIGNAL(triggered()),
this, SLOT(configurePlatformss()));
+ // TODO: deprecated
configMediaTypeAction = new QAction(tr("&Media Types"), this);
configMediaTypeAction->setStatusTip(tr("Configure media types"));
connect(configMediaTypeAction, SIGNAL(triggered()), this, SLOT(configureMediaTypes()));
+ configMediaTypesAction = new QAction(tr("&Set Media Types"), this);
+ configMediaTypeAction->setStatusTip(tr("Add, edit and delete media types"));
+ connect(configMediaTypesAction, SIGNAL(triggered()), this, SLOT(configureMediaTypess()));
+
configMediaImagePathAction = new QAction(tr("Media &Image Paths"), this);
configMediaImagePathAction->setStatusTip(tr("Configure media image file paths."));
connect(configMediaImagePathAction, SIGNAL(triggered()),
connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
}
+// TODO: deprecated
void MainWindow::configurePlatforms()
{
if (!platformDialog)
void MainWindow::configurePlatformss()
{
- plfDialog = new PlatformMainDialog(this);
- connect(plfDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
+ if (!plfDialog) {
+ plfDialog = new PlatformMainDialog(this);
+ connect(plfDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
+ }
activateDialog(plfDialog);
}
+// TODO: deprecated
void MainWindow::configureMediaTypes()
{
if (!mediaTypeDialog)
activateDialog(mediaTypeDialog);
}
+void MainWindow::configureMediaTypess()
+{
+ if (!mdtDialog)
+ {
+ mdtDialog = new MediaTypeMainDialog(this);
+ connect(mdtDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
+ }
+ activateDialog(mdtDialog);
+}
+
+
void MainWindow::configureMediaImagePaths()
{
if (!mediaImagePathDialog)
configMenu = menuBar()->addMenu(tr("&Config"));
configMenu->addAction(configTmpDirAction);
configMenu->addSeparator();
+ // TODO: deprecated
configMenu->addAction(configPlatformAction);
configMenu->addAction(configPlatformsAction);
+ // TODO: deprecated
configMenu->addAction(configMediaTypeAction);
+ configMenu->addAction(configMediaTypesAction);
configMenu->addAction(configSetupAction);
configMenu->addAction(configMediaImagePathAction);
configMenu->addAction(configEmulatorAction);
#include <QMainWindow>
class QAction;
+// TODO: DEPRECATED
class PlatformDialog;
class PlatformMainDialog;
+class MediaTypeMainDialog;
+// TODO: DEPRECATED
class MediaTypeDialog;
+class MediaTypeMainDialog;
class MediaImagePathMainDialog;
class SetupMainDialog;
class ExecutableMainDialog;
void closeEvent(QCloseEvent *event);
private slots:
+ // TODO: DEPRECATED
void configurePlatforms();
void configurePlatformss();
+ // TODO: DEPRECATED
void configureMediaTypes();
+ void configureMediaTypess();
void configureMediaImagePaths();
void configureSetups();
void configureEmulators();
void activateDialog(EmuFrontDialog*) const;
bool testDB(bool reset);
void createDB() const;
+
+ // TODO: deprecated
PlatformDialog *platformDialog;
PlatformMainDialog *plfDialog;
+ // TODO: deprecated
MediaTypeDialog *mediaTypeDialog;
+ MediaTypeMainDialog *mdtDialog;
MediaImagePathMainDialog *mediaImagePathDialog;
SetupMainDialog *setupMainDialog;
ExecutableMainDialog *executableMainDialog;
QMenu *configMenu;
QMenu *fileMenu;
QMenu *helpMenu;
+ // TODO: deprecated
QAction *configPlatformAction;
QAction *configPlatformsAction;
+ // TODO: deprecated
QAction *configMediaTypeAction;
+ QAction *configMediaTypesAction;
QAction *configMediaImagePathAction;
QAction *configSetupAction;
QAction *configEmulatorAction;