Implemented ExternalExecutableEditView utilising
authorMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 12 Dec 2010 23:11:33 +0000 (01:11 +0200)
committerMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 12 Dec 2010 23:11:33 +0000 (01:11 +0200)
ExternalExecutableModel. Used new view in MainWindow.

src/emufront.pro
src/mainwindow.cpp
src/mainwindow.h
src/views/externalexecutableeditview.cpp [new file with mode: 0644]
src/views/externalexecutableeditview.h [new file with mode: 0644]
src/views/filepatheditview.h

index 15f1ee3..5be00cb 100644 (file)
@@ -99,7 +99,8 @@ HEADERS += mainwindow.h \
     views/filepatheditview.h \
     delegates/filesystembrowsedelegate.h \
     widgets/filepathselectorwidget.h \
-    models/externalexecutablemodel.h
+    models/externalexecutablemodel.h \
+    views/externalexecutableeditview.h
 SOURCES += main.cpp \
     mainwindow.cpp \
     db/databasemanager.cpp \
@@ -174,7 +175,8 @@ SOURCES += main.cpp \
     views/filepatheditview.cpp \
     delegates/filesystembrowsedelegate.cpp \
     widgets/filepathselectorwidget.cpp \
-    models/externalexecutablemodel.cpp
+    models/externalexecutablemodel.cpp \
+    views/externalexecutableeditview.cpp
 OTHER_FILES +=  
 
 CONFIG += mobility
index b59ea3b..0d6c0a3 100644 (file)
@@ -33,7 +33,9 @@
 // TODO: deprecated
 #include "setupmaindialog.h"
 #include "setupeditview.h"
+// TODO: deprecated
 #include "executablemaindialog.h"
+#include "externalexecutableeditview.h"
 #include "datfileutil.h"
 #include "databasemanager.h"
 #include "dbcreator.h"
@@ -77,7 +79,9 @@ MainWindow::MainWindow(bool reset)
     // TODO: deprecated
     setupMainDialog = 0;
     setupMainView = 0;
+    // TODO: deprecated
     executableMainDialog = 0;
+    emulatorEditView = 0;
 }
 
 void MainWindow::connectSignals()
@@ -130,6 +134,11 @@ void MainWindow::createActions()
     configEmulatorAction->setStatusTip(tr("Configure emulators"));
     connect(configEmulatorAction, SIGNAL(triggered()), this, SLOT(configureEmulators()));
 
+    configEmulatorsAction = new QAction(tr("Configure Em&ulators"), this);
+    configEmulatorsAction->setStatusTip(tr("Add, edit and delete emulator configurations"));
+    connect(configEmulatorsAction, SIGNAL(triggered()), this, SLOT(configureEmulatorss()));
+
+
     configTmpDirAction = new QAction(tr("&Temp dir"), this);
     configTmpDirAction->setStatusTip(tr("Configure directory for temporary files."));
     connect(configTmpDirAction, SIGNAL(triggered()), this, SLOT(configureTmpDir()));
@@ -233,6 +242,7 @@ void MainWindow::configureSetupss()
 }
 
 
+// TODO: deprecated
 void MainWindow::configureEmulators()
 {
     if (!executableMainDialog) {
@@ -243,6 +253,15 @@ void MainWindow::configureEmulators()
     executableMainDialog->refreshDataModel();
 }
 
+void MainWindow::configureEmulatorss()
+{
+    if (!emulatorEditView) {
+        emulatorEditView = new ExternalExecutableEditView(this);
+        connect(emulatorEditView, SIGNAL(finished(int)), this, SLOT(updateData()));
+    }
+    activateDialog(emulatorEditView);
+}
+
 void MainWindow::configureTmpDir()
 {
     /*if (!tmpFolderDialog) {
@@ -313,7 +332,9 @@ void MainWindow::createMenus()
     // TODO: DEPRECATED
     configMenu->addAction(configMediaImagePathAction);
     configMenu->addAction(configMediaImagePathsAction);
+    // TODO: DEPRECATED
     configMenu->addAction(configEmulatorAction);
+    configMenu->addAction(configEmulatorsAction);
     configMenu->addSeparator();
     configMenu->addAction(manageDatFilesAction);
 
index eb6d2b2..e2a102b 100644 (file)
@@ -36,7 +36,9 @@ class FilePathEditView;
 // TODO: DEPRECATED
 class SetupMainDialog;
 class SetupEditView;
+// TODO: DEPRECATED
 class ExecutableMainDialog;
+class ExternalExecutableEditView;
 //class TmpFolderEditDialog;
 class QLabel;
 class DatabaseManager;
@@ -69,7 +71,9 @@ private slots:
     // TODO: DEPRECATED
     void configureSetups();
     void configureSetupss();
+    // TODO: DEPRECATED
     void configureEmulators();
+    void configureEmulatorss();
     void configureTmpDir();
     void resetDb();
     void updateData();
@@ -102,7 +106,9 @@ private:
     // TODO: deprecated
     SetupMainDialog *setupMainDialog;
     SetupEditView *setupMainView;
+    // TODO: deprecated
     ExecutableMainDialog *executableMainDialog;
+    ExternalExecutableEditView *emulatorEditView;
     //TmpFolderEditDialog *tmpFolderDialog;
        QMenu *configMenu;
     QMenu *fileMenu;
@@ -119,7 +125,9 @@ private:
     // TODO: deprecated
     QAction *configSetupAction;
     QAction *configSetupsAction;
+    // TODO: deprecated
     QAction *configEmulatorAction;
+    QAction *configEmulatorsAction;
     QAction *exitAction;
     QAction *resetDbAction;
     QAction *aboutAction;
diff --git a/src/views/externalexecutableeditview.cpp b/src/views/externalexecutableeditview.cpp
new file mode 100644 (file)
index 0000000..6d1c504
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+** 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 "externalexecutableeditview.h"
+#include "externalexecutablemodel.h"
+#include "setupmodel.h"
+#include "comboboxdelegate.h"
+#include <QtGui>
+
+ExternalExecutableEditView::ExternalExecutableEditView(QWidget *parent) :
+    EmuFrontEditView(parent)
+{
+    model = new ExternalExecutableModel(this);
+    objectList->setModel(model);
+    SetupModel *stupMdl = new SetupModel(this);
+    ComboBoxDelegate *setupDelegate = new ComboBoxDelegate(
+        stupMdl,
+        SetupModel::Setup_Id,
+        SetupModel::Setup_Name,
+        this
+    );
+    objectList->setItemDelegateForColumn(ExternalExecutableModel::Executable_SetupId, setupDelegate);
+    postInit();
+}
diff --git a/src/views/externalexecutableeditview.h b/src/views/externalexecutableeditview.h
new file mode 100644 (file)
index 0000000..a01ce79
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+** 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 EXTERNALEXECUTABLEEDITVIEW_H
+#define EXTERNALEXECUTABLEEDITVIEW_H
+
+#include "emufronteditview.h"
+
+class ExternalExecutableEditView : public EmuFrontEditView
+{
+    Q_OBJECT
+public:
+    explicit ExternalExecutableEditView(QWidget *parent = 0);
+
+signals:
+
+public slots:
+
+};
+
+#endif // EXTERNALEXECUTABLEEDITVIEW_H
index 616b3cc..60cd4f9 100644 (file)
@@ -17,7 +17,8 @@
 **
 ** You should have received a copy of the GNU General Public License
 ** along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
-*/#ifndef FILEPATHEDITVIEW_H
+*/
+#ifndef FILEPATHEDITVIEW_H
 #define FILEPATHEDITVIEW_H
 
 #include "emufronteditview.h"