Merge pull request #292 from lack/offline_username_limits
Limit offline username to 16 characters with override
This commit is contained in:
parent
bf6fa6bce4
commit
ddda02f092
@ -42,6 +42,15 @@ void OfflineLoginDialog::setUserInputsEnabled(bool enable)
|
|||||||
ui->buttonBox->setEnabled(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.
|
// Enable the OK button only when the textbox contains something.
|
||||||
void OfflineLoginDialog::on_userTextBox_textEdited(const QString &newText)
|
void OfflineLoginDialog::on_userTextBox_textEdited(const QString &newText)
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,7 @@ slots:
|
|||||||
void onTaskProgress(qint64 current, qint64 total);
|
void onTaskProgress(qint64 current, qint64 total);
|
||||||
|
|
||||||
void on_userTextBox_textEdited(const QString &newText);
|
void on_userTextBox_textEdited(const QString &newText);
|
||||||
|
void on_allowLongUsernames_stateChanged(int value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::OfflineLoginDialog *ui;
|
Ui::OfflineLoginDialog *ui;
|
||||||
|
@ -35,11 +35,24 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="userTextBox">
|
<widget class="QLineEdit" name="userTextBox">
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>16</number>
|
||||||
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>Username</string>
|
<string>Username</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="allowLongUsernames">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Usernames longer than 16 characters cannot be used for LAN games or offline-mode servers.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Allow long usernames</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QProgressBar" name="progressBar">
|
<widget class="QProgressBar" name="progressBar">
|
||||||
<property name="value">
|
<property name="value">
|
||||||
|
Loading…
Reference in New Issue
Block a user