Modified the license text comment type.
[emufront] / src / mainwindow.cpp
index 858aede..b59ea3b 100644 (file)
@@ -1,38 +1,43 @@
-// 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/>.
-
+/*
+** 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 "mainwindow.h"
 #include "emulauncher.h"
 // TODO: deprecated
-#include "dialogs/platformdialog.h"
-#include "dialogs/platformmaindialog.h"
-#include "dialogs/mediatypedialog.h"
+#include "platformdialog.h"
+#include "platformeditview.h"
+#include "mediatypedialog.h"
+// TODO: deprecated
+#include "mediatypeeditview.h"
+// TODO: DEPRECATED
+#include "mediaimagepathmaindialog.h"
+#include "filepatheditview.h"
 // TODO: deprecated
-#include "dialogs/mediatypemaindialog.h"
-#include "dialogs/mediaimagepathmaindialog.h"
-#include "dialogs/setupmaindialog.h"
-#include "dialogs/executablemaindialog.h"
-#include "utils/datfileutil.h"
-#include "db/databasemanager.h"
-#include "db/dbcreator.h"
-#include "db/dbconfig.h"
+#include "setupmaindialog.h"
+#include "setupeditview.h"
+#include "executablemaindialog.h"
+#include "datfileutil.h"
+#include "databasemanager.h"
+#include "dbcreator.h"
+#include "dbconfig.h"
 
 QString MainWindow::aboutStr = trUtf8(
         "<h2>EmuFront</h2>"
@@ -66,8 +71,12 @@ MainWindow::MainWindow(bool reset)
     // TODO: deprecated
     mediaTypeDialog = 0;
     mdtDialog = 0;
+    // TODO: DEPRECATED
     mediaImagePathDialog = 0;
+    mediaImagePathView = 0;
+    // TODO: deprecated
     setupMainDialog = 0;
+    setupMainView = 0;
     executableMainDialog = 0;
 }
 
@@ -97,15 +106,26 @@ void MainWindow::createActions()
     configMediaTypeAction->setStatusTip(tr("Add, edit and delete media types"));
     connect(configMediaTypesAction, SIGNAL(triggered()), this, SLOT(configureMediaTypess()));
 
+    // TODO: DEPRECATED
     configMediaImagePathAction = new QAction(tr("Media &Image Paths"), this);
     configMediaImagePathAction->setStatusTip(tr("Configure media image file paths."));
     connect(configMediaImagePathAction, SIGNAL(triggered()),
         this, SLOT(configureMediaImagePaths()));
 
+    configMediaImagePathsAction = new QAction(tr("Set media &image paths"), this);
+    configMediaImagePathsAction->setStatusTip(tr("Add, edit and delete media image file paths."));
+    connect(configMediaImagePathsAction, SIGNAL(triggered()),
+        this, SLOT(configureMediaImagePathss()));
+
+    // TODO: deprecated
     configSetupAction = new QAction(tr("S&etups"), this);
     configSetupAction->setStatusTip(tr("Configure set ups"));
     connect(configSetupAction, SIGNAL(triggered()), this, SLOT(configureSetups()));
 
+    configSetupsAction = new QAction(tr("Configure S&etups"), this);
+    configSetupsAction->setStatusTip(tr("Add, edit and delete setups"));
+    connect(configSetupsAction, SIGNAL(triggered()), this, SLOT(configureSetupss()));
+
     configEmulatorAction = new QAction(tr("Em&ulators"), this);
     configEmulatorAction->setStatusTip(tr("Configure emulators"));
     connect(configEmulatorAction, SIGNAL(triggered()), this, SLOT(configureEmulators()));
@@ -146,7 +166,7 @@ void MainWindow::configurePlatforms()
 void MainWindow::configurePlatformss()
 {
     if (!plfDialog) {
-        plfDialog = new PlatformMainDialog(this);
+        plfDialog = new PlatformEditView(this);
         connect(plfDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
     }
     activateDialog(plfDialog);
@@ -167,13 +187,14 @@ void MainWindow::configureMediaTypess()
 {
     if (!mdtDialog)
     {
-        mdtDialog = new MediaTypeMainDialog(this);
+        mdtDialog = new MediaTypeEditView(this);
         connect(mdtDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
    }
    activateDialog(mdtDialog);
 }
 
 
+// TODO: DEPRECATED
 void MainWindow::configureMediaImagePaths()
 {
     if (!mediaImagePathDialog)
@@ -183,17 +204,35 @@ void MainWindow::configureMediaImagePaths()
     activateDialog(mediaImagePathDialog);
 }
 
+void MainWindow::configureMediaImagePathss()
+{
+    if (!mediaImagePathView)
+    {
+        mediaImagePathView = new FilePathEditView(this);
+    }
+    activateDialog(mediaImagePathView);
+}
+
+// TODO: deprecated
 void MainWindow::configureSetups()
 {
     if (!setupMainDialog)
     {
-        qDebug() << "MainWindow: Creating a setup main dialog.";
         setupMainDialog = new SetupMainDialog(this);
     }
     activateDialog(setupMainDialog);
     setupMainDialog->refreshDataModel();
 }
 
+void MainWindow::configureSetupss()
+{
+    if (!setupMainView) {
+        setupMainView = new SetupEditView(this);
+    }
+    activateDialog(setupMainView);
+}
+
+
 void MainWindow::configureEmulators()
 {
     if (!executableMainDialog) {
@@ -268,8 +307,12 @@ void MainWindow::createMenus()
     // TODO: deprecated
     configMenu->addAction(configMediaTypeAction);
     configMenu->addAction(configMediaTypesAction);
+    // TODO: deprecated
     configMenu->addAction(configSetupAction);
+    configMenu->addAction(configSetupsAction);
+    // TODO: DEPRECATED
     configMenu->addAction(configMediaImagePathAction);
+    configMenu->addAction(configMediaImagePathsAction);
     configMenu->addAction(configEmulatorAction);
     configMenu->addSeparator();
     configMenu->addAction(manageDatFilesAction);