From 2e62f6e8d8aded1036f96835ebebd4d656c0fcc2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 6 May 2013 21:28:28 -0500 Subject: [PATCH] Implemented version selection stuff. --- gui/mainwindow.cpp | 6 +++++- gui/newinstancedialog.cpp | 5 +++++ gui/newinstancedialog.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 96609531..22055b51 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -177,6 +177,7 @@ void MainWindow::on_actionAddInstance_triggered() if (error == InstanceLoader::NoError) { newInstance->setName(newInstDlg->instName()); + newInstance->setIntendedVersion(newInstDlg->selectedVersion()->descriptor()); instList.add(InstancePtr(newInstance)); } else @@ -418,5 +419,8 @@ void MainWindow::on_actionChangeInstMCVersion_triggered() Instance *inst = (Instance *)index.data(InstanceModel::InstancePointerRole).value(); VersionSelectDialog *vselect = new VersionSelectDialog(inst->versionList(), this); - vselect->exec(); + if (vselect->exec() && vselect->selectedVersion()) + { + inst->setIntendedVersion(vselect->selectedVersion()->descriptor()); + } } diff --git a/gui/newinstancedialog.cpp b/gui/newinstancedialog.cpp index 2034664d..ccdea063 100644 --- a/gui/newinstancedialog.cpp +++ b/gui/newinstancedialog.cpp @@ -106,3 +106,8 @@ void NewInstanceDialog::on_btnChangeVersion_clicked() setSelectedVersion(version); } } + +void NewInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) +{ + updateDialogState(); +} diff --git a/gui/newinstancedialog.h b/gui/newinstancedialog.h index ea730b3c..1970e37a 100644 --- a/gui/newinstancedialog.h +++ b/gui/newinstancedialog.h @@ -46,6 +46,8 @@ public: private slots: void on_btnChangeVersion_clicked(); + void on_instNameTextBox_textChanged(const QString &arg1); + private: Ui::NewInstanceDialog *ui;