From cc00062121876fb60a0d7639b8b3c7d26248f209 Mon Sep 17 00:00:00 2001 From: chenlelin Date: Sat, 30 Jan 2021 10:04:04 +0800 Subject: [PATCH] Fix bug add hidden WiFi interface, network name is recommended to increase the number of characters limit --- src/wpawifidialog.cpp | 6 ++++++ wireless-security/dlghidewifi.cpp | 5 +++++ wireless-security/dlghidewifiwpa.cpp | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/src/wpawifidialog.cpp b/src/wpawifidialog.cpp index 7c921f21..dd883119 100644 --- a/src/wpawifidialog.cpp +++ b/src/wpawifidialog.cpp @@ -411,6 +411,7 @@ void WpaWifiDialog::initConnect() { }); connect(pwdEditor, &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() { @@ -419,6 +420,11 @@ void WpaWifiDialog::slot_line_edit_changed() { } else { connectBtn->setEnabled(false); } + + if (nameEditor->text().size() > 32) { + QString cutStr = nameEditor->text().mid(0,32); + nameEditor->setText(cutStr); + } } void WpaWifiDialog::slot_on_connectBtn_clicked() { diff --git a/wireless-security/dlghidewifi.cpp b/wireless-security/dlghidewifi.cpp index 2e552ae4..66bf07a6 100644 --- a/wireless-security/dlghidewifi.cpp +++ b/wireless-security/dlghidewifi.cpp @@ -337,6 +337,11 @@ void DlgHideWifi::on_leNetName_textEdited(const QString &arg1) } else { 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() diff --git a/wireless-security/dlghidewifiwpa.cpp b/wireless-security/dlghidewifiwpa.cpp index 61e6e46b..3422da3c 100644 --- a/wireless-security/dlghidewifiwpa.cpp +++ b/wireless-security/dlghidewifiwpa.cpp @@ -400,6 +400,11 @@ void DlgHideWifiWpa::on_leNetName_textEdited(const QString &arg1) } else { 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)