mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Better failure messages
This commit is contained in:
parent
0770d464be
commit
28e92d1a3c
1 changed files with 18 additions and 6 deletions
|
|
@ -530,6 +530,11 @@ void TabReplays::actGetReplayCode()
|
||||||
|
|
||||||
void TabReplays::getReplayCodeFinished(const Response &r, const CommandContainer & /*commandContainer*/)
|
void TabReplays::getReplayCodeFinished(const Response &r, const CommandContainer & /*commandContainer*/)
|
||||||
{
|
{
|
||||||
|
if (r.response_code() == Response::RespFunctionNotAllowed) {
|
||||||
|
QMessageBox::warning(this, tr("Failed"), tr("This server does not support replay sharing."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (r.response_code() != Response::RespOk) {
|
if (r.response_code() != Response::RespOk) {
|
||||||
QMessageBox::warning(this, tr("Failed"), tr("Could not get replay code."));
|
QMessageBox::warning(this, tr("Failed"), tr("Could not get replay code."));
|
||||||
return;
|
return;
|
||||||
|
|
@ -559,12 +564,19 @@ void TabReplays::actSubmitReplayCode()
|
||||||
|
|
||||||
void TabReplays::submitReplayCodeFinished(const Response &r, const CommandContainer & /*commandContainer*/)
|
void TabReplays::submitReplayCodeFinished(const Response &r, const CommandContainer & /*commandContainer*/)
|
||||||
{
|
{
|
||||||
if (r.response_code() == Response::RespOk) {
|
switch (r.response_code()) {
|
||||||
QMessageBox::information(this, tr("Success"), tr("Replay code found. Replay was added"));
|
case Response::RespOk:
|
||||||
} else if (r.response_code() == Response::RespNameNotFound) {
|
QMessageBox::information(this, tr("Success"), tr("Replay code found. Replay was added."));
|
||||||
QMessageBox::warning(this, tr("Failed"), tr("Code not found"));
|
break;
|
||||||
} else {
|
case Response_ResponseCode_RespNameNotFound:
|
||||||
QMessageBox::warning(this, tr("Failed"), tr("Unexpected error"));
|
QMessageBox::warning(this, tr("Failed"), tr("Code not found."));
|
||||||
|
break;
|
||||||
|
case Response::RespFunctionNotAllowed:
|
||||||
|
QMessageBox::warning(this, tr("Failed"), tr("This server does not support replay sharing."));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
QMessageBox::warning(this, tr("Failed"), tr("Unexpected error"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue