mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Added custom notify user event (#2398)
* Added custom notify user event. * Untabbify
This commit is contained in:
parent
0fdb9b7c83
commit
b64eab204c
2 changed files with 17 additions and 0 deletions
|
|
@ -587,6 +587,20 @@ void TabSupervisor::processNotifyUserEvent(const Event_NotifyUser &event)
|
|||
QMessageBox::warning(this, tr("Warned"), tr("You have received a warning due to %1.\nPlease refrain from engaging in this activity or further actions may be taken against you. If you have any questions, please private message a moderator.").arg(QString::fromStdString(event.warning_reason()).simplified()));
|
||||
break;
|
||||
}
|
||||
case Event_NotifyUser::CUSTOM: {
|
||||
if (!QString::fromStdString(event.custom_title()).simplified().isEmpty() && !QString::fromStdString(event.custom_content()).simplified().isEmpty()) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setParent(this);
|
||||
msgBox.setWindowFlags(Qt::Dialog);
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.setWindowTitle(QString::fromStdString(event.custom_title()).simplified());
|
||||
msgBox.setText(tr("You have received the following message from the server.\n(custom messages like these could be untranslated)"));
|
||||
msgBox.setDetailedText(QString::fromStdString(event.custom_content()).simplified());
|
||||
msgBox.setMinimumWidth(200);
|
||||
msgBox.exec();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: ;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue