[new] 新增正则表达式和管理员密码输入
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include "getroutedialog.h"
|
||||
#include "device/networkmanager.h"
|
||||
|
||||
GetRouteDialog::GetRouteDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog(parent, f) {
|
||||
|
||||
setWindowModality(Qt::WindowModal);
|
||||
@@ -16,10 +18,13 @@ GetRouteDialog::GetRouteDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBase
|
||||
QString value2 = QString("Netmask");
|
||||
_mask = new QLineEdit(this);
|
||||
form->addRow(value2, _mask);
|
||||
QString value3 = QString("Destination");
|
||||
QString value3 = QString("Gateway");
|
||||
_gw = new QLineEdit(this);
|
||||
form->addRow(value3, _gw);
|
||||
|
||||
lbl_error = new QLabel(this);
|
||||
lbl_error->setObjectName("warn");
|
||||
form->addRow("", lbl_error);
|
||||
}
|
||||
|
||||
GetRouteDialog::~GetRouteDialog() {
|
||||
@@ -42,5 +47,18 @@ void GetRouteDialog::setList(const QStringList& list)
|
||||
}
|
||||
|
||||
bool GetRouteDialog::updateReferenceData() {
|
||||
|
||||
if (!NetworkManager::validate(_des->text())) {
|
||||
lbl_error->setText(tr("Wrong Destination!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(_des->text())) {
|
||||
lbl_error->setText(tr("Wrong Netmask!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(_des->text())) {
|
||||
lbl_error->setText(tr("Wrong Gateway!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user