--- /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 as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Foobar 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/>.
+
+#include <QtGui>
+#include "setupmaindialog.h"
+#include "../db/dbsetup.h"
+
+SetupMainDialog::SetupMainDialog(QWidget *parent)
+ : DbObjectDialog(parent)
+{
+ setWindowTitle(tr("Setups"));
+ //nameDialog = new SetupEditor(this, dynamic_cast<Setup*>(dbObject));
+ dbManager = new DbSetup(this);
+ initDataTable();
+ connectSignals();
+}
+
+SetupMainDialog::~SetupMainDialog()
+{
+ deleteCurrentObject();
+}
+
+void SetupMainDialog::deleteCurrentObject()
+{
+ delete dynamic_cast<Setup*>(dbObject);
+ dbObject = 0;
+}
+
+EmuFrontObject* SetupMainDialog::createObject()
+{
+ return new Setup;
+}
+
+/*void SetupMainDialog::connectSignals()
+{
+}*/
--- /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 as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Foobar 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/>.
+
+#ifndef SETUPMAINDIALOG_H
+#define SETUPMAINDIALOG_H
+
+#include "dbobjectdialog.h"
+
+class SetupMainDialog : public DbObjectDialog
+{
+ Q_OBJECT
+
+public:
+ SetupMainDialog(QWidget *parent);
+ ~SetupMainDialog();
+
+protected:
+ virtual void deleteCurrentObject();
+ virtual EmuFrontObject* createObject();
+ //virtual void connectSignals();
+
+};
+
+#endif // SETUPMAINDIALOG_H
dataobjects/setup.h \
db/dbsetup.h \
db/dbtablemodelmanager.h \
- db/dbquerymodelmanager.h
+ db/dbquerymodelmanager.h \
+ dialogs/setupmaindialog.h
SOURCES += main.cpp \
mainwindow.cpp \
db/databasemanager.cpp \
dataobjects/setup.cpp \
db/dbsetup.cpp \
db/dbtablemodelmanager.cpp \
- db/dbquerymodelmanager.cpp
+ db/dbquerymodelmanager.cpp \
+ dialogs/setupmaindialog.cpp
OTHER_FILES +=
#include "dialogs/platformdialog.h"
#include "dialogs/mediatypedialog.h"
#include "dialogs/mediaimagepathmaindialog.h"
+#include "dialogs/setupmaindialog.h"
#include "db/databasemanager.h"
MainWindow::MainWindow()
connect(configMediaImagePathAction, SIGNAL(triggered()),
this, SLOT(configureMediaImagePaths()));
+ configSetupAction = new QAction(tr("S&etups"), this);
+ configSetupAction->setStatusTip(tr("Configure set ups"));
+ connect(configSetupAction, SIGNAL(triggered()), this, SLOT(configureSetups()));
+
exitAction = new QAction(tr("&Exit"), this);
exitAction->setShortcut(tr("Ctrl+Q"));
exitAction->setStatusTip(tr("Exit EmuFront"));
activateDialog(mediaImagePathDialog);
}
+void MainWindow::configureSetups()
+{
+ if (!setupMainDialog)
+ {
+ setupMainDialog = new SetupMainDialog(this);
+ }
+ activateDialog(setupMainDialog);
+}
+
void MainWindow::activateDialog(EmuFrontDialog* dia) const
{
dia->show();
dia->activateWindow();
}
-
void MainWindow::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
configMenu->addAction(configPlatformAction);
configMenu->addAction(configMediaTypeAction);
configMenu->addAction(configMediaImagePathAction);
+ configMenu->addAction(configSetupAction);
}
void MainWindow::createStatusBar()
class PlatformDialog;
class MediaTypeDialog;
class MediaImagePathMainDialog;
+class SetupMainDialog;
class QLabel;
class DatabaseManager;
class EmuFrontDialog;
void configurePlatforms();
void configureMediaTypes();
void configureMediaImagePaths();
+ void configureSetups();
private:
void createActions();
PlatformDialog *platformDialog;
MediaTypeDialog *mediaTypeDialog;
MediaImagePathMainDialog *mediaImagePathDialog;
+ SetupMainDialog *setupMainDialog;
QMenu *configMenu;
QMenu *fileMenu;
QAction *configPlatformAction;
QAction *configMediaTypeAction;
QAction *configMediaImagePathAction;
+ QAction *configSetupAction;
QAction *exitAction;
QLabel *messageLabel;
DatabaseManager *dbManager;