aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/dialogs/OfflineLoginDialog.cpp
diff options
context:
space:
mode:
authorJim Ramsay <i.am@jimramsay.com>2022-03-17 21:47:34 -0400
committerJim Ramsay <i.am@jimramsay.com>2022-03-19 10:12:07 -0400
commit90780818cab043003cb4d18d3865323ce07fb92d (patch)
treeb8215c7f83b58251313d88acdac64d73f3ddbfca /launcher/ui/dialogs/OfflineLoginDialog.cpp
parentacdb54b88e0fbdcb46aba3ed3d90e8b7fed08357 (diff)
downloadPrismLauncher-90780818cab043003cb4d18d3865323ce07fb92d.tar.gz
PrismLauncher-90780818cab043003cb4d18d3865323ce07fb92d.tar.bz2
PrismLauncher-90780818cab043003cb4d18d3865323ce07fb92d.zip
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>
Diffstat (limited to 'launcher/ui/dialogs/OfflineLoginDialog.cpp')
-rw-r--r--launcher/ui/dialogs/OfflineLoginDialog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/launcher/ui/dialogs/OfflineLoginDialog.cpp b/launcher/ui/dialogs/OfflineLoginDialog.cpp
index 345ed40a..4f3d8be4 100644
--- a/launcher/ui/dialogs/OfflineLoginDialog.cpp
+++ b/launcher/ui/dialogs/OfflineLoginDialog.cpp
@@ -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)
{