Limit offline username to 16 characters with override
Offline usernames longer than 16 characters won't be able to connect to LAN games or offline-mode servers, so just don't let it happen. Add a checkbox to allow people to unrestrict usernames if they want. Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
This commit is contained in:
@ -42,6 +42,15 @@ void OfflineLoginDialog::setUserInputsEnabled(bool enable)
|
||||
ui->buttonBox->setEnabled(enable);
|
||||
}
|
||||
|
||||
void OfflineLoginDialog::on_allowLongUsernames_stateChanged(int value)
|
||||
{
|
||||
if (value == Qt::Checked) {
|
||||
ui->userTextBox->setMaxLength(INT_MAX);
|
||||
} else {
|
||||
ui->userTextBox->setMaxLength(16);
|
||||
}
|
||||
}
|
||||
|
||||
// Enable the OK button only when the textbox contains something.
|
||||
void OfflineLoginDialog::on_userTextBox_textEdited(const QString &newText)
|
||||
{
|
||||
|
Reference in New Issue
Block a user