#include "emuhelper.h"
#include "emufrontinputdialog.h"
-EmuLauncher::EmuLauncher(QErrorMessage *errorMessage, QWidget *parent, QString tmp) :
- QWidget(parent), tmpDirPath(tmp), errorMessage(errorMessage)
+EmuLauncher::EmuLauncher(QErrorMessage *errorMessage, SetupModel *supModel, QWidget *parent, QString tmp) :
+ QWidget(parent), supModel(supModel), tmpDirPath(tmp), errorMessage(errorMessage)
{
emuHelper = new EmuHelper(this);
initWidgets();
micModel = new MediaImageContainerModel(this);
micTable->setModel(micModel);
- supModel = new SetupModel(this);
+ //supModel = new SetupModel(this);
setupSelectBox = new QComboBox(this);
setupSelectBox->setModel(supModel);
setupSelectBox->setModelColumn(SetupModel::Setup_Name);
// 1. get selected platform and media type id
QAbstractItemModel *setupAbsModel = setupSelectBox->model();
- SetupModel *supModel = qobject_cast<SetupModel *>(setupAbsModel);
- if (!supModel) return;
+ //SetupModel *supModel = qobject_cast<SetupModel *>(setupAbsModel);
+ //if (!supModel) return;
QModelIndex supInd =
supModel->index(setupSelectBox->currentIndex(), SetupModel::Setup_Id);
{
Q_OBJECT
public:
- EmuLauncher(QErrorMessage *, QWidget *parent = 0, QString tmp = ".");
+ EmuLauncher(QErrorMessage *, SetupModel *supModel, QWidget *parent = 0, QString tmp = ".");
~EmuLauncher();
void updateData();
void setTmpDirPath(QString);
#include "databasemanager.h"
#include "dbcreator.h"
#include "dbconfig.h"
+#include "setupmodel.h"
QString MainWindow::aboutStr = trUtf8(
"<h2>EmuFront</h2>"
if (tmpDirFilePath.isEmpty())
tmpDirFilePath = QDir::homePath();
qDebug() << "Temporary dir is " << tmpDirFilePath;
- launcher = new EmuLauncher(errorMessage, this, tmpDirFilePath);
+ supModel = new SetupModel(this);
+ launcher = new EmuLauncher(errorMessage, supModel, this, tmpDirFilePath);
setCentralWidget(launcher);
createActions();
createMenus();
void MainWindow::configureSetupss()
{
+ //TODO: maybe a common setup model in MainWindow, so the data would be in sync without refresh with updateData!
if (!setupMainView) {
- setupMainView = new SetupEditView(this);
- connect(setupMainView, SIGNAL(finished(int)), this, SLOT(updateData()));
+ setupMainView = new SetupEditView(supModel, this);
+ //connect(setupMainView, SIGNAL(finished(int)), this, SLOT(updateData()));
}
activateDialog(setupMainView);
}
class EmuLauncher;
class DatFileUtil;
class QErrorMessage;
+class SetupModel;
class MainWindow : public QMainWindow
{
EmuLauncher *launcher;
QString tmpDirFilePath;
QErrorMessage *errorMessage;
+ SetupModel *supModel;
};
#endif
**
** You should have received a copy of the GNU General Public License
** along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
-*/#ifndef EMUFRONTDATADIALOG_H
+*/
+#ifndef EMUFRONTDATADIALOG_H
#define EMUFRONTDATADIALOG_H
#include "emufrontdialog.h"
#include "mediatypemodel.h"
#include <QSqlTableModel>
-SetupEditView::SetupEditView(QWidget *parent) :
- EmuFrontEditView(parent)
+SetupEditView::SetupEditView(SetupModel *supModel, QWidget *parent) :
+ EmuFrontEditView(parent)//, model(supModel)
{
- model = new SetupModel(this);
+ model = supModel;
+ //model = new SetupModel(this);
objectList->setModel(model);
PlatformModel *plfModel = new PlatformModel(this);
ComboBoxDelegate *platformDelegate = new ComboBoxDelegate(
#include "emufronteditview.h"
+class SetupModel;
+
class SetupEditView : public EmuFrontEditView
{
Q_OBJECT
public:
- SetupEditView(QWidget *parent = 0);
+ SetupEditView(SetupModel *supModel, QWidget *parent = 0);
signals:
public slots:
+private:
+
};
#endif // SETUPMAINVIEW_H