mirror of
https://github.com/chenx-dust/EZ4Connect.git
synced 2026-09-20 10:23:33 +08:00
feat: enhance login and settings functionality with credential validation and UI improvements
- Added credential validation in login and settings windows to ensure non-empty and ASCII-only username/password. - Introduced a checkbox to toggle password visibility in both login and settings interfaces. - Updated UI elements for better layout and user experience, including adjustments to labels and button properties. - Refactored signal connections for button actions to improve clarity and functionality.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include "loginwindow.h"
|
||||
|
||||
#include "../utils/utils.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
LoginWindow::LoginWindow(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
@@ -11,23 +14,22 @@ LoginWindow::LoginWindow(QWidget *parent)
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted,
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked,
|
||||
[&]()
|
||||
{
|
||||
if (ui->usernameLineEdit->text().isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, "警告", "账号不应为空!");
|
||||
if (!Utils::credentialCheck(ui->usernameLineEdit->text(), ui->passwordLineEdit->text()))
|
||||
return;
|
||||
}
|
||||
else if (ui->passwordLineEdit->text().isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, "警告", "密码不应为空!");
|
||||
return;
|
||||
}
|
||||
emit login(ui->usernameLineEdit->text(), ui->passwordLineEdit->text(), ui->saveLoginDetailCheckBox->isChecked());
|
||||
emit accept();
|
||||
}
|
||||
);
|
||||
|
||||
connect(ui->passwordVisibleCheckBox, &QCheckBox::checkStateChanged,
|
||||
[&](Qt::CheckState state)
|
||||
{
|
||||
ui->passwordLineEdit->setEchoMode(state == Qt::Checked ? QLineEdit::Normal : QLineEdit::Password);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
LoginWindow::~LoginWindow()
|
||||
|
||||
@@ -20,10 +20,17 @@
|
||||
<string>登录</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="passwordLineEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label2">
|
||||
<property name="text">
|
||||
<string>密码</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="saveLoginDetailCheckBox">
|
||||
<property name="text">
|
||||
<string>记住登录信息(可在设置中删除)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -34,33 +41,33 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label2">
|
||||
<item row="3" column="2">
|
||||
<widget class="QCheckBox" name="passwordVisibleCheckBox">
|
||||
<property name="text">
|
||||
<string>密码</string>
|
||||
<string>显示密码</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="passwordLineEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::EchoMode::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="usernameLineEdit"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="saveLoginDetailCheckBox">
|
||||
<property name="text">
|
||||
<string>记住登录信息(可在设置中删除)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -38,14 +38,14 @@ SettingWindow::SettingWindow(QWidget *parent, QSettings *inputSettings) :
|
||||
|
||||
auto applySettings = [&]()
|
||||
{
|
||||
if (settings->value("Common/AutoStart").toBool() != (ui->autoStartComboBox->currentText() == "是"))
|
||||
Utils::setAutoStart(ui->autoStartComboBox->currentText() == "是");
|
||||
if (settings->value("Common/AutoStart").toBool() != ui->autoStartCheckBox->isChecked())
|
||||
Utils::setAutoStart(ui->autoStartCheckBox->isChecked());
|
||||
|
||||
settings->setValue("Common/Username", ui->usernameLineEdit->text());
|
||||
settings->setValue("Common/Password", QString(ui->passwordLineEdit->text().toUtf8().toBase64()));
|
||||
settings->setValue("Common/AutoStart", ui->autoStartComboBox->currentText() == "是");
|
||||
settings->setValue("Common/ConnectAfterStart", ui->connectAfterStartComboBox->currentText() == "是");
|
||||
settings->setValue("Common/checkUpdateAfterStart", ui->checkUpdateAfterStartComboBox->currentText() == "是");
|
||||
settings->setValue("Common/AutoStart", ui->autoStartCheckBox->isChecked());
|
||||
settings->setValue("Common/ConnectAfterStart", ui->connectAfterStartCheckBox->isChecked());
|
||||
settings->setValue("Common/checkUpdateAfterStart", ui->checkUpdateAfterStartCheckBox->isChecked());
|
||||
|
||||
settings->setValue("ZJUConnect/ServerAddress", ui->serverAddressLineEdit->text());
|
||||
settings->setValue("ZJUConnect/ServerPort", ui->serverPortSpinBox->value());
|
||||
@@ -71,9 +71,18 @@ SettingWindow::SettingWindow(QWidget *parent, QSettings *inputSettings) :
|
||||
settings->sync();
|
||||
};
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, applySettings);
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, [&, applySettings](){
|
||||
if (!Utils::credentialCheck(ui->usernameLineEdit->text(), ui->passwordLineEdit->text()))
|
||||
return;
|
||||
applySettings();
|
||||
accept();
|
||||
});
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, applySettings);
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, [&, applySettings](){
|
||||
if (!Utils::credentialCheck(ui->usernameLineEdit->text(), ui->passwordLineEdit->text()))
|
||||
return;
|
||||
applySettings();
|
||||
});
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked,
|
||||
[&]()
|
||||
@@ -93,6 +102,12 @@ SettingWindow::SettingWindow(QWidget *parent, QSettings *inputSettings) :
|
||||
ui->routeCheckBox->setEnabled(checked);
|
||||
ui->dnsHijackCheckBox->setEnabled(checked);
|
||||
});
|
||||
|
||||
connect(ui->passwordVisibleCheckBox, &QCheckBox::checkStateChanged,
|
||||
[&](Qt::CheckState state)
|
||||
{
|
||||
ui->passwordLineEdit->setEchoMode(state == Qt::Checked ? QLineEdit::Normal : QLineEdit::Password);
|
||||
});
|
||||
}
|
||||
|
||||
SettingWindow::~SettingWindow()
|
||||
@@ -107,12 +122,9 @@ void SettingWindow::loadSettings()
|
||||
QByteArray::fromBase64(settings->value("Common/Password", "").toString().toUtf8())
|
||||
);
|
||||
|
||||
ui->autoStartComboBox->setCurrentText(
|
||||
settings->value("Common/AutoStart", false).toBool() ? "是" : "否");
|
||||
ui->connectAfterStartComboBox->setCurrentText(
|
||||
settings->value("Common/ConnectAfterStart", false).toBool() ? "是" : "否");
|
||||
ui->checkUpdateAfterStartComboBox->setCurrentText(
|
||||
settings->value("Common/checkUpdateAfterStart", true).toBool() ? "是" : "否");
|
||||
ui->autoStartCheckBox->setChecked(settings->value("Common/AutoStart", false).toBool());
|
||||
ui->connectAfterStartCheckBox->setChecked(settings->value("Common/ConnectAfterStart", false).toBool());
|
||||
ui->checkUpdateAfterStartCheckBox->setChecked(settings->value("Common/checkUpdateAfterStart", true).toBool());
|
||||
|
||||
ui->serverAddressLineEdit->setText(settings->value("ZJUConnect/ServerAddress", "vpn.hitsz.edu.cn").toString());
|
||||
ui->serverPortSpinBox->setValue(settings->value("ZJUConnect/ServerPort", 443).toInt());
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>486</width>
|
||||
<height>396</height>
|
||||
<height>406</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -30,134 +30,12 @@
|
||||
<string>通用</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>启动时</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="commonTabLable5">
|
||||
<property name="text">
|
||||
<string>启动后自动连接</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="commonTabLable4">
|
||||
<property name="text">
|
||||
<string>开机自启动</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="autoStartComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>否</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>是</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="connectAfterStartComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>否</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>是</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>221</width>
|
||||
<height>72</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="commonTabLable6">
|
||||
<property name="text">
|
||||
<string>启动后检查更新</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="checkUpdateAfterStartComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>否</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>是</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<spacer name="commonTabVerticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>444</width>
|
||||
<height>108</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>保存的信息</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="usernameLineEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="commonTabLable2">
|
||||
<property name="text">
|
||||
@@ -165,10 +43,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="passwordLineEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="usernameLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>VPN 账号(一般为学号)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QCheckBox" name="passwordVisibleCheckBox">
|
||||
<property name="text">
|
||||
<string>显示密码</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -179,13 +64,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="passwordLineEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::EchoMode::Password</enum>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>VPN 密码(一般为统一认证密码)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
<enum>QSizePolicy::Policy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -198,6 +93,83 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>启动时</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="commonTabLable6">
|
||||
<property name="text">
|
||||
<string>启动后检查更新</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="commonTabLable4">
|
||||
<property name="text">
|
||||
<string>开机自启动</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>221</width>
|
||||
<height>72</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="commonTabLable5">
|
||||
<property name="text">
|
||||
<string>启动后自动连接</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QCheckBox" name="checkUpdateAfterStartCheckBox">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="connectAfterStartCheckBox">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="autoStartCheckBox">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<spacer name="commonTabVerticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>444</width>
|
||||
<height>108</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="zjuConnectTab">
|
||||
@@ -229,7 +201,7 @@
|
||||
<item row="8" column="0" colspan="4">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -423,7 +395,7 @@
|
||||
<item row="13" column="0" colspan="4">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -467,7 +439,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
|
||||
<set>QDialogButtonBox::StandardButton::Apply|QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok|QDialogButtonBox::StandardButton::RestoreDefaults</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -477,9 +449,6 @@
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>usernameLineEdit</tabstop>
|
||||
<tabstop>passwordLineEdit</tabstop>
|
||||
<tabstop>autoStartComboBox</tabstop>
|
||||
<tabstop>connectAfterStartComboBox</tabstop>
|
||||
<tabstop>checkUpdateAfterStartComboBox</tabstop>
|
||||
<tabstop>serverAddressLineEdit</tabstop>
|
||||
<tabstop>serverPortSpinBox</tabstop>
|
||||
<tabstop>dnsLineEdit</tabstop>
|
||||
@@ -518,21 +487,5 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SettingWindow</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>239</x>
|
||||
<y>374</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>242</x>
|
||||
<y>197</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
||||
@@ -70,7 +70,7 @@ void Utils::showAboutMessageBox(QWidget *parent)
|
||||
messageBox.setWindowTitle("关于");
|
||||
messageBox.setTextFormat(Qt::RichText);
|
||||
QString aboutText = QApplication::applicationDisplayName() + " " + QApplication::applicationVersion() +
|
||||
"<br>针对哈工大深圳的修改版 ZJU-Connect-for-Windows" +
|
||||
"<br>专注于 ZJU-Connect 的 ZJU-Connect-for-Windows (HITsz 版)" +
|
||||
"<br>作者:<a href='https://github.com/chenx-dust'>Chenx Dust</a>" +
|
||||
"<br>项目主页:<a href='https://github.com/" + REPO_NAME + "'>https://github.com/" + REPO_NAME + "</a>" +
|
||||
"<br><br>ZJU-Connect-for-Windows" +
|
||||
@@ -258,4 +258,38 @@ void Utils::setAutoStart(bool enable)
|
||||
desktopFile.close();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
bool Utils::credentialCheck(const QString &username, const QString &password)
|
||||
{
|
||||
if (username.isEmpty() || password.isEmpty())
|
||||
{
|
||||
int status = QMessageBox::warning(nullptr, "警告", "账号或密码为空!\n\n是否继续?", QMessageBox::Ok, QMessageBox::Cancel);
|
||||
return status == QMessageBox::Ok;
|
||||
}
|
||||
|
||||
bool asciiOnly = true;
|
||||
for (QChar c: username)
|
||||
{
|
||||
if (c.unicode() > 127)
|
||||
{
|
||||
asciiOnly = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (QChar c: password)
|
||||
{
|
||||
if (c.unicode() > 127)
|
||||
{
|
||||
asciiOnly = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!asciiOnly)
|
||||
{
|
||||
int status = QMessageBox::warning(nullptr, "警告", "账号或密码存在非 ASCII 字符!\n建议检查输入法设置。\n\n是否继续?", QMessageBox::Ok, QMessageBox::Cancel);
|
||||
return status == QMessageBox::Ok;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace Utils
|
||||
QString getIpv4Address(const QString &interfaceName);
|
||||
|
||||
void setAutoStart(bool enable);
|
||||
|
||||
bool credentialCheck(const QString &username, const QString &password);
|
||||
}
|
||||
|
||||
#endif //UTILS_H
|
||||
|
||||
Reference in New Issue
Block a user