From 4ed296bad493f2cefbde275fea79a91a1849e886 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 3 Aug 2022 20:37:10 +0200 Subject: [PATCH 1/2] fix: allow user to interrupt launch after 3 tries Signed-off-by: Sefa Eyeoglu --- launcher/LaunchController.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index d36ee3fed..38df1b04e 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -145,16 +145,25 @@ void LaunchController::login() { return; } - // we try empty password first :) - QString password; // we loop until the user succeeds in logging in or gives up bool tryagain = true; - // the failure. the default failure. - const QString needLoginAgain = tr("Your account is currently not logged in. Please enter your password to log in again.

This could be caused by a password change."); - QString failReason = needLoginAgain; + unsigned int tries = 0; while (tryagain) { + if (tries > 0 && tries % 3 == 0) { + auto result = QMessageBox::question( + m_parentWidget, + tr("Continue launch?"), + tr("It looks like we couldn't launch after %1 tries. Do you want to continue trying?") + .arg(tries) + ); + + if (result == QMessageBox::No) { + return; + } + } + tries++; m_session = std::make_shared(); m_session->wants_online = m_online; m_accountToUse->fillSession(m_session); From 355762aa303361819340cc2f8b92ada326a7e03d Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 4 Aug 2022 10:02:54 +0200 Subject: [PATCH 2/2] fix: emit abort in LaunchController Signed-off-by: Sefa Eyeoglu --- launcher/Application.cpp | 3 +++ launcher/LaunchController.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 2bd91fd70..c4bb84e43 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -1258,6 +1258,9 @@ bool Application::launch( } connect(controller.get(), &LaunchController::succeeded, this, &Application::controllerSucceeded); connect(controller.get(), &LaunchController::failed, this, &Application::controllerFailed); + connect(controller.get(), &LaunchController::aborted, this, [this] { + controllerFailed(tr("Aborted")); + }); addRunningInstance(); controller->start(); return true; diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 38df1b04e..11f9b2bbf 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -160,6 +160,7 @@ void LaunchController::login() { ); if (result == QMessageBox::No) { + emitAborted(); return; } }