From f26be005716818b643a0c8b1373dbe83e4cdcfbf Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 13 Oct 2022 13:49:06 -0300 Subject: fix: abort search if we're already trying to download a pack Meaning we don't have to wait for the searches to finish in the background to finally start the modpack download, when we have already selected it -_- Signed-off-by: flow --- launcher/ui/dialogs/NewInstanceDialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'launcher/ui/dialogs') diff --git a/launcher/ui/dialogs/NewInstanceDialog.cpp b/launcher/ui/dialogs/NewInstanceDialog.cpp index d203795a..df182f09 100644 --- a/launcher/ui/dialogs/NewInstanceDialog.cpp +++ b/launcher/ui/dialogs/NewInstanceDialog.cpp @@ -139,6 +139,10 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString void NewInstanceDialog::reject() { APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64()); + + // This is just so that the pages get the close() call and can react to it, if needed. + m_container->prepareToClose(); + QDialog::reject(); } @@ -146,6 +150,10 @@ void NewInstanceDialog::accept() { APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64()); importIconNow(); + + // This is just so that the pages get the close() call and can react to it, if needed. + m_container->prepareToClose(); + QDialog::accept(); } -- cgit