summaryrefslogtreecommitdiff
path: root/src/createinstancedialog.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-11-12 03:16:44 -0500
committerGitHub <noreply@github.com>2020-11-12 03:16:44 -0500
commit85f515da2d1713bc208d2f1bca4197b91950528a (patch)
tree0eb2c9b5dcc26a1b658ef49c28c09af39728df09 /src/createinstancedialog.cpp
parentf7de8618124199977c4f4919e70bbfd2693ed341 (diff)
parent6ae27224b0dcc860b882bebff3149828d874c832 (diff)
Merge pull request #1294 from isanae/master
Bunch of instance and command line stuff
Diffstat (limited to 'src/createinstancedialog.cpp')
-rw-r--r--src/createinstancedialog.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/createinstancedialog.cpp b/src/createinstancedialog.cpp
index 47cb9d5c..a4e3c336 100644
--- a/src/createinstancedialog.cpp
+++ b/src/createinstancedialog.cpp
@@ -131,7 +131,7 @@ CreateInstanceDialog::CreateInstanceDialog(
ui->pages->setCurrentIndex(0);
ui->launch->setChecked(true);
- if (!m_settings)
+ if (!InstanceManager::singleton().hasAnyInstances())
{
// first run of MO, there are no instances yet, force launch
ui->launch->setEnabled(false);
@@ -314,6 +314,10 @@ void CreateInstanceDialog::finish()
};
+ // don't restart if this is the first instance, it'll be selected and opened
+ const bool mustRestart = InstanceManager::singleton().hasAnyInstances();
+
+
try
{
std::vector<std::unique_ptr<DirectoryCreator>> dirs;
@@ -396,9 +400,7 @@ void CreateInstanceDialog::finish()
if (ui->launch->isChecked()) {
InstanceManager::singleton().setCurrentInstance(ci.instanceName);
- if (m_settings) {
- // don't restart without settings, it happens on startup when there are
- // no instances
+ if (mustRestart) {
ExitModOrganizer(Exit::Restart);
m_switching = true;
}