Fix bug add hidden WiFi interface, network name is recommended to increase the number of characters limit

This commit is contained in:
chenlelin 2021-01-30 10:04:04 +08:00
parent 24f357bb5d
commit cc00062121
3 changed files with 16 additions and 0 deletions

View File

@ -411,6 +411,7 @@ void WpaWifiDialog::initConnect() {
}); });
connect(pwdEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed); connect(pwdEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed);
connect(userEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed); connect(userEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed);
connect(nameEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed);
} }
void WpaWifiDialog::slot_line_edit_changed() { void WpaWifiDialog::slot_line_edit_changed() {
@ -419,6 +420,11 @@ void WpaWifiDialog::slot_line_edit_changed() {
} else { } else {
connectBtn->setEnabled(false); connectBtn->setEnabled(false);
} }
if (nameEditor->text().size() > 32) {
QString cutStr = nameEditor->text().mid(0,32);
nameEditor->setText(cutStr);
}
} }
void WpaWifiDialog::slot_on_connectBtn_clicked() { void WpaWifiDialog::slot_on_connectBtn_clicked() {

View File

@ -337,6 +337,11 @@ void DlgHideWifi::on_leNetName_textEdited(const QString &arg1)
} else { } else {
ui->btnConnect->setEnabled(true); ui->btnConnect->setEnabled(true);
} }
if (ui->leNetName->text().size() > 32) {
QString cutStr = ui->leNetName->text().mid(0,32);
ui->leNetName->setText(cutStr);
}
} }
void DlgHideWifi::slotStartLoading() void DlgHideWifi::slotStartLoading()

View File

@ -400,6 +400,11 @@ void DlgHideWifiWpa::on_leNetName_textEdited(const QString &arg1)
} else { } else {
ui->btnConnect->setEnabled(true); ui->btnConnect->setEnabled(true);
} }
if (ui->leNetName->text().size() > 32) {
QString cutStr = ui->leNetName->text().mid(0,32);
ui->leNetName->setText(cutStr);
}
} }
void DlgHideWifiWpa::on_lePassword_textEdited(const QString &arg1) void DlgHideWifiWpa::on_lePassword_textEdited(const QString &arg1)