[new] 新增正则表达式和管理员密码输入
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include "getipdialog.h"
|
||||
#include "device/networkmanager.h"
|
||||
|
||||
GetIPDialog::GetIPDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog(parent, f) {
|
||||
|
||||
setWindowModality(Qt::WindowModal);
|
||||
@@ -17,6 +19,9 @@ GetIPDialog::GetIPDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog
|
||||
_mask = new QLineEdit(this);
|
||||
form->addRow(value2, _mask);
|
||||
|
||||
lbl_error = new QLabel(this);
|
||||
lbl_error->setObjectName("warn");
|
||||
form->addRow("", lbl_error);
|
||||
|
||||
}
|
||||
|
||||
@@ -39,5 +44,14 @@ void GetIPDialog::setList(const QStringList& list)
|
||||
}
|
||||
|
||||
bool GetIPDialog::updateReferenceData() {
|
||||
|
||||
if (!NetworkManager::validate(_ip->text())) {
|
||||
lbl_error->setText(tr("Wrong IP!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(_mask->text())) {
|
||||
lbl_error->setText(tr("Wrong Netmask!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user