diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-11-13 16:14:31 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-11-13 16:14:31 +0100 |
| commit | 1facda19438bf01e5b8e08b7ebeb7f3a1c21028f (patch) | |
| tree | bb5b9483c32b781b58ae275e4850fd85596573e0 /src/createinstancedialog.cpp | |
| parent | 4d94ba8dbba20da6d030a8a3adf73d2dbd6fc56f (diff) | |
| parent | 85f515da2d1713bc208d2f1bca4197b91950528a (diff) | |
Merge branch 'master' of github.com:ModOrganizer2/modorganizer into iplugin-isactive-refactoring
Diffstat (limited to 'src/createinstancedialog.cpp')
| -rw-r--r-- | src/createinstancedialog.cpp | 10 |
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; } |
