mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[Client] Show confirmation when adding a user to the ignore list (#1875)
Nothing in the UI confirmed that a user had been added to the ignore list, so the action felt ambiguous and could be repeated by accident. Show an information dialog when the server acknowledges the add-to-ignore command.
This commit is contained in:
parent
0f003eabf9
commit
39278c5274
1 changed files with 9 additions and 1 deletions
|
|
@ -606,7 +606,15 @@ void UserContextMenu::execAddToIgnore(const QString &userName)
|
|||
Command_AddToList cmd;
|
||||
cmd.set_list("ignore");
|
||||
cmd.set_user_name(userName.toStdString());
|
||||
client->sendCommand(client->prepareSessionCommand(cmd));
|
||||
PendingCommand *pend = client->prepareSessionCommand(cmd);
|
||||
connect(pend, &PendingCommand::finished, this,
|
||||
[this, userName](const Response &response, const CommandContainer &, const QVariant &) {
|
||||
if (response.response_code() == Response::RespOk) {
|
||||
QMessageBox::information(static_cast<QWidget *>(parent()), tr("Ignore list"),
|
||||
tr("%1 has been added to your ignore list.").arg(userName));
|
||||
}
|
||||
});
|
||||
client->sendCommand(pend);
|
||||
}
|
||||
|
||||
void UserContextMenu::execRemoveFromIgnore(const QString &userName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue