From bf7cf61b85850642479ba0a547e2b647e246faf6 Mon Sep 17 00:00:00 2001 From: Gavin Bisesi Date: Sat, 8 Aug 2015 09:48:18 -0400 Subject: [PATCH 1/2] Add more informative message on unrecognized login response When logging in and receiving a reply that isn't understood, show a more informative error message. `tr() + tr()` for better translation flexibility. --- cockatrice/src/window_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index 47dccd51..ed1846a6 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -331,7 +331,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32 break; } default: - QMessageBox::critical(this, tr("Error"), tr("Unknown login error: %1").arg(static_cast(r))); + QMessageBox::critical(this, tr("Error"), tr("Unknown login error: %1".).arg(static_cast(r)) + tr("\nThis usually means that your client version is out of date, and the server sent a reply your client doesn't understand.")); break; } actConnect(); From 481a57edf6bed8c0a6daae633d178134e33e3199 Mon Sep 17 00:00:00 2001 From: Gavin Bisesi Date: Sat, 8 Aug 2015 09:55:23 -0400 Subject: [PATCH 2/2] Show more informative error on registration failure --- cockatrice/src/window_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index ed1846a6..ed8fc577 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -331,7 +331,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32 break; } default: - QMessageBox::critical(this, tr("Error"), tr("Unknown login error: %1".).arg(static_cast(r)) + tr("\nThis usually means that your client version is out of date, and the server sent a reply your client doesn't understand.")); + QMessageBox::critical(this, tr("Error"), tr("Unknown login error: %1").arg(static_cast(r)) + tr("\nThis usually means that your client version is out of date, and the server sent a reply your client doesn't understand.")); break; } actConnect(); @@ -410,7 +410,7 @@ void MainWindow::registerError(Response::ResponseCode r, QString reasonStr, quin QMessageBox::critical(this, tr("Error"), tr("Registration failed for a technical problem on the server.")); break; default: - QMessageBox::critical(this, tr("Error"), tr("Unknown login error: %1").arg(static_cast(r))); + QMessageBox::critical(this, tr("Error"), tr("Unknown registration error: %1").arg(static_cast(r)) + tr("\nThis usually means that your client version is out of date, and the server sent a reply your client doesn't understand.")); } actRegister(); }