diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-07-25 22:08:43 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-03 11:39:05 -0500 |
| commit | dfbcf8ec4c6da4d2d098403a01e7ec19b587e836 (patch) | |
| tree | f911eb6a6ec4dfafb767ce8d2ddb7802f1a0ca05 /src/createinstancedialog.cpp | |
| parent | 0389688f3b30b9888bb94a08991bc1de00b89c59 (diff) | |
restart when finished, added launch instance checkbox
Diffstat (limited to 'src/createinstancedialog.cpp')
| -rw-r--r-- | src/createinstancedialog.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 <iplugingame.h> #include <utility.h> @@ -27,6 +28,7 @@ CreateInstanceDialog::CreateInstanceDialog( m_pages.push_back(std::make_unique<ConfirmationPage>(*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 |
