mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
show error code in dialog, change text for no internet
Signed-off-by: Tayou <git@tayou.org>
This commit is contained in:
parent
768d12259b
commit
d71cfc33a2
6 changed files with 17 additions and 2 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include "minecraft/auth/AccountList.h"
|
||||
|
||||
#include "ui/InstanceWindow.h"
|
||||
#include "net/NetUtils.h"
|
||||
#include "ui/dialogs/CustomMessageBox.h"
|
||||
#include "ui/dialogs/MSALoginDialog.h"
|
||||
#include "ui/dialogs/ProfileSelectDialog.h"
|
||||
|
|
@ -185,8 +186,16 @@ LaunchDecision LaunchController::decideLaunchMode()
|
|||
case AccountState::Offline: {
|
||||
if (m_wantedLaunchMode == LaunchMode::Normal) {
|
||||
QMessageBox msg(m_parentWidget);
|
||||
msg.setWindowTitle(tr("Auth servers offline"));
|
||||
msg.setText(tr("The Minecraft authentication servers are currently unavailable."));
|
||||
|
||||
auto netErr = accountToCheck->accountData()->networkError;
|
||||
if (Net::isServerError(netErr)) {
|
||||
msg.setWindowTitle(tr("Auth servers offline"));
|
||||
msg.setText(tr("The Minecraft authentication servers are currently unavailable.\n\n%1").arg(accountToCheck->lastError()));
|
||||
} else {
|
||||
msg.setWindowTitle(tr("No internet connection"));
|
||||
msg.setText(tr("Unable to connect to the internet.\n\n%1").arg(accountToCheck->lastError()));
|
||||
}
|
||||
|
||||
msg.setIcon(QMessageBox::Warning);
|
||||
|
||||
auto* launchOfflineButton = msg.addButton(tr("Launch Offline"), QMessageBox::AcceptRole);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue