From dfbcf8ec4c6da4d2d098403a01e7ec19b587e836 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 25 Jul 2020 22:08:43 -0400 Subject: restart when finished, added launch instance checkbox --- src/createinstancedialog.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/createinstancedialog.cpp') diff --git a/src/createinstancedialog.cpp b/src/createinstancedialog.cpp index 4b9f24ae..63df9cd7 100644 --- a/src/createinstancedialog.cpp +++ b/src/createinstancedialog.cpp @@ -3,6 +3,7 @@ #include "createinstancedialogpages.h" #include "instancemanager.h" #include "settings.h" +#include "shared/util.h" #include "shared/appconfig.h" #include #include @@ -27,6 +28,7 @@ CreateInstanceDialog::CreateInstanceDialog( m_pages.push_back(std::make_unique(*this)); ui->pages->setCurrentIndex(0); + ui->launch->setChecked(true); updateNavigation(); @@ -287,6 +289,14 @@ void CreateInstanceDialog::finish() } logCreation(tr("Done.")); + + if (ui->launch->isChecked()) { + InstanceManager::instance().setCurrentInstance(ci.instanceName); + ExitModOrganizer(Exit::Restart); + } else { + ui->next->setEnabled(false); + ui->cancel->setText(tr("Close")); + } } catch(Failed&) { @@ -328,6 +338,10 @@ void CreateInstanceDialog::updateNavigation() } else { ui->next->setText(m_originalNext); } + + // this may have been changed by finish() if the launch checkbox wasn't + // checked + ui->cancel->setText(tr("Cancel")); } CreateInstanceDialog::Types CreateInstanceDialog::instanceType() const -- cgit v1.3.1