Modified the license text comment type.
[emufront] / src / mainwindow.cpp
index 928ea76..b59ea3b 100644 (file)
@@ -1,34 +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"
-#include "dialogs/platformdialog.h"
-#include "dialogs/mediatypedialog.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"
+// TODO: deprecated
+#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 "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>"
@@ -56,10 +65,18 @@ MainWindow::MainWindow(bool reset)
     createMenus();
     createStatusBar();
     readSettings();
+    // TODO: deprecated
     platformDialog = 0;
+    plfDialog = 0;
+    // TODO: deprecated
     mediaTypeDialog = 0;
+    mdtDialog = 0;
+    // TODO: DEPRECATED
     mediaImagePathDialog = 0;
+    mediaImagePathView = 0;
+    // TODO: deprecated
     setupMainDialog = 0;
+    setupMainView = 0;
     executableMainDialog = 0;
 }
 
@@ -69,24 +86,46 @@ void MainWindow::connectSignals()
 
 void MainWindow::createActions()
 {
+    // TODO: deprecated
     configPlatformAction = new QAction(tr("&Platforms"), this);
     configPlatformAction->setStatusTip(tr("Configure platforms"));
     connect(configPlatformAction, SIGNAL(triggered()),
-           this, SLOT(configurePlatforms()));
+        this, SLOT(configurePlatforms()));
+
+    configPlatformsAction = new QAction(tr("&Set Platforms"), this);
+    configPlatformsAction->setStatusTip(tr("Add, edit and delete platforms"));
+    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()));
+
+    // 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()));
@@ -113,6 +152,7 @@ void MainWindow::createActions()
     connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
 }
 
+// TODO: deprecated
 void MainWindow::configurePlatforms()
 {
    if (!platformDialog)
@@ -123,6 +163,16 @@ void MainWindow::configurePlatforms()
    activateDialog(platformDialog);
 }
 
+void MainWindow::configurePlatformss()
+{
+    if (!plfDialog) {
+        plfDialog = new PlatformEditView(this);
+        connect(plfDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
+    }
+    activateDialog(plfDialog);
+}
+
+// TODO: deprecated
 void MainWindow::configureMediaTypes()
 {
     if (!mediaTypeDialog)
@@ -133,6 +183,18 @@ void MainWindow::configureMediaTypes()
    activateDialog(mediaTypeDialog);
 }
 
+void MainWindow::configureMediaTypess()
+{
+    if (!mdtDialog)
+    {
+        mdtDialog = new MediaTypeEditView(this);
+        connect(mdtDialog, SIGNAL(finished(int)), this, SLOT(updateData()));
+   }
+   activateDialog(mdtDialog);
+}
+
+
+// TODO: DEPRECATED
 void MainWindow::configureMediaImagePaths()
 {
     if (!mediaImagePathDialog)
@@ -142,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) {
@@ -221,10 +301,18 @@ void MainWindow::createMenus()
     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);
+    // TODO: deprecated
     configMenu->addAction(configSetupAction);
+    configMenu->addAction(configSetupsAction);
+    // TODO: DEPRECATED
     configMenu->addAction(configMediaImagePathAction);
+    configMenu->addAction(configMediaImagePathsAction);
     configMenu->addAction(configEmulatorAction);
     configMenu->addSeparator();
     configMenu->addAction(manageDatFilesAction);