From a4747a1ecc9f4fe56700c64933cc3c6cebd04734 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 3 Nov 2020 12:10:41 -0500 Subject: show create instance dialog on startup if there are no instances --- src/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') 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 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); -- cgit v1.3.1