diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-12-24 23:38:37 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-12-24 23:39:04 +0100 |
commit | 8d0ca72abb10b0cb77816d44f3f768865cc23aef (patch) | |
tree | 07a866c3625bad8369ed55dea89034b288358591 /gui/MainWindow.cpp | |
parent | 027aafc3c1fc5e78c91ee439cd38562387f7ed9f (diff) | |
download | MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar.gz MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar.lz MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar.xz MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.zip |
Log SSL errors, give common solutions
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r-- | gui/MainWindow.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 179f881f..4fb4489f 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -865,6 +865,8 @@ void MainWindow::doLaunch() if (!account.get()) return; + QString failReason = tr("Your account is currently not logged in. Please enter " + "your password to log in again."); // do the login. if the account has an access token, try to refresh it first. if (account->accountStatus() != NotVerified) { @@ -879,13 +881,28 @@ void MainWindow::doLaunch() { updateInstance(m_selectedInstance, account); } - // revert from online to verified. + else + { + if (!task->successful()) + { + failReason = task->failReason(); + } + if (loginWithPassword(account, failReason)) + updateInstance(m_selectedInstance, account); + } + // in any case, revert from online to verified. + account->downgrade(); + } + else + { + if (loginWithPassword(account, failReason)) + { + updateInstance(m_selectedInstance, account); + account->downgrade(); + } + // in any case, revert from online to verified. account->downgrade(); - return; } - if (loginWithPassword(account, tr("Your account is currently not logged in. Please enter " - "your password to log in again."))) - updateInstance(m_selectedInstance, account); } bool MainWindow::loginWithPassword(MojangAccountPtr account, const QString &errorMsg) |