diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-03 12:10:41 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-03 12:10:41 -0500 |
| commit | a4747a1ecc9f4fe56700c64933cc3c6cebd04734 (patch) | |
| tree | daddf9542d5bb5e686d2d628abec83fd8c46a20f /src/main.cpp | |
| parent | 7b1e30b4649bc9ed8844cbc0d330aaf150957373 (diff) | |
show create instance dialog on startup if there are no instances
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index bfc074ec..bd7f8303 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -277,10 +277,20 @@ void openInstanceManager(PluginContainer& pc, QWidget* parent); std::optional<Instance> selectInstance() { NexusInterface ni(nullptr); - PluginContainer pc(nullptr); pc.loadPlugins(); + if (InstanceManager::instance().instancePaths().empty()) { + // no instances configured + CreateInstanceDialog dlg(pc, nullptr); + if (dlg.exec() != QDialog::Accepted) { + return {}; + } + + return InstanceManager::instance().currentInstance(); + } + + InstanceManagerDialog dlg(pc); dlg.setRestartOnSelect(false); |
