summaryrefslogtreecommitdiff
path: root/src/instancemanagerdialog.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-11-12 03:15:14 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-11-12 03:15:14 -0500
commit6ae27224b0dcc860b882bebff3149828d874c832 (patch)
tree0eb2c9b5dcc26a1b658ef49c28c09af39728df09 /src/instancemanagerdialog.cpp
parenta0c26517028a25ccd39dc92f9da8539f25db85fc (diff)
fixed a bunch of instance and command line stuff
- clear instance manager overrides when restarting, or switching instances after starting MO with moshortcut://instance: won't do anything - clear overrides when the last selected instance can't be opened; MO would keep trying to open shortcuts even after selecting a different instance - command line was cleared too early, before the first run, so shortcuts were broken - the instance manager dialog can be opened without an instance loaded if the last selected instance doesn't exist, createNew() would throw because it tried to access the global Settings - fixed some problems with parts of MO wanting to restart and others expecting flow to continue - fixed create instance dialog using settings pointer to decide whether to restart; it restarts when it's the first created instance, which is not always the case even if the settings are null, so just check whether there are instances
Diffstat (limited to 'src/instancemanagerdialog.cpp')
-rw-r--r--src/instancemanagerdialog.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/instancemanagerdialog.cpp b/src/instancemanagerdialog.cpp
index ff76e121..2497d8d8 100644
--- a/src/instancemanagerdialog.cpp
+++ b/src/instancemanagerdialog.cpp
@@ -580,13 +580,17 @@ void InstanceManagerDialog::onSelection()
void InstanceManagerDialog::createNew()
{
- CreateInstanceDialog dlg(m_pc, &Settings::instance(), this);
+ // there might not be settings available; the dialog can be shown when the
+ // last selected instance doesn't exist anymore
+ CreateInstanceDialog dlg(m_pc, Settings::maybeInstance(), this);
+
if (dlg.exec() != QDialog::Accepted) {
return;
}
if (dlg.switching()) {
// restarting MO
+ accept();
return;
}