From 66c19ab72780264175a63c697bfcfe3bfc100c6a Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Mon, 31 Aug 2015 01:00:13 -0400 Subject: [PATCH] Detect if a use is trying to place an invalid ban --- cockatrice/src/userlist.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cockatrice/src/userlist.cpp b/cockatrice/src/userlist.cpp index 59717608..b7a52a4c 100644 --- a/cockatrice/src/userlist.cpp +++ b/cockatrice/src/userlist.cpp @@ -122,6 +122,25 @@ void BanDialog::okClicked() QMessageBox::critical(this, tr("Error"), tr("You have to select a name-based, IP-based, clientId based, or some combination of the three to place a ban.")); return; } + + if (nameBanCheckBox->isChecked()) + if (nameBanEdit->text() == ""){ + QMessageBox::critical(this, tr("Error"), tr("You must have at value in the name ban when selecting the name ban checkbox.")); + return; + } + + if (ipBanCheckBox->isChecked()) + if (ipBanEdit->text() == ""){ + QMessageBox::critical(this, tr("Error"), tr("You must have at value in the ip ban when selecting the ip ban checkbox.")); + return; + } + + if (idBanCheckBox->isChecked()) + if (idBanCheckBox->text() == ""){ + QMessageBox::critical(this, tr("Error"), tr("You must have at value in the clientid ban when selecting the clientid ban checkbox.")); + return; + } + accept(); }