diff options
| author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-08-03 20:37:10 +0200 | 
|---|---|---|
| committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-08-03 20:38:40 +0200 | 
| commit | 4ed296bad493f2cefbde275fea79a91a1849e886 (patch) | |
| tree | f687a7a1732948d242a06403f5a9d478812c9b37 | |
| parent | 6fd3672618f425bb539f4d554a5fda5d1236d042 (diff) | |
| download | PrismLauncher-4ed296bad493f2cefbde275fea79a91a1849e886.tar.gz PrismLauncher-4ed296bad493f2cefbde275fea79a91a1849e886.tar.bz2 PrismLauncher-4ed296bad493f2cefbde275fea79a91a1849e886.zip | |
fix: allow user to interrupt launch after 3 tries
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
| -rw-r--r-- | launcher/LaunchController.cpp | 19 | 
1 files changed, 14 insertions, 5 deletions
| diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index d36ee3fe..38df1b04 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. <br /> <br /> 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<AuthSession>();          m_session->wants_online = m_online;          m_accountToUse->fillSession(m_session); | 
