Add confirm password in AccountFormDialog.
This commit is contained in:
@@ -24,6 +24,7 @@ AccountFormDialog::AccountFormDialog(QWidget* parent, AccountEditMode mode, Qt::
|
||||
, mLeUserName(new ULineEdit(this))
|
||||
, mLeComment(new ULineEdit(this))
|
||||
, mLePwd(nullptr)
|
||||
, mConfirmPwd(nullptr)
|
||||
, mBtnPwd(nullptr)
|
||||
, mLblError(new QLabel(this))
|
||||
, mRefModel(nullptr)
|
||||
@@ -181,6 +182,15 @@ void AccountFormDialog::addNewModeUI(QVBoxLayout* layout)
|
||||
layout->addWidget(mLePwd);
|
||||
mRoleID = User::getRoleID("doctor");
|
||||
addEndLine(layout);
|
||||
|
||||
lblPwd = new QLabel(this);
|
||||
lblPwd->setText(tr("Confirm Password"));
|
||||
layout->addWidget(lblPwd);
|
||||
mConfirmPwd = new ULineEdit(this);
|
||||
mConfirmPwd->setPlaceholderText(tr("Input password"));
|
||||
mConfirmPwd->setEchoMode(QLineEdit::Password);
|
||||
layout->addWidget(mConfirmPwd);
|
||||
addEndLine(layout);
|
||||
}
|
||||
|
||||
bool AccountFormDialog::updateReferenceData()
|
||||
@@ -253,6 +263,11 @@ bool AccountFormDialog::updateReferenceData()
|
||||
warn(tr("Password can't be empty!"));
|
||||
return false;
|
||||
}
|
||||
if (mLePwd->text() != mConfirmPwd->text())
|
||||
{
|
||||
warn(tr("Password and confirm password do not match!"));
|
||||
return false;
|
||||
}
|
||||
if (!mRefModel)
|
||||
{
|
||||
warn(tr("Inner error ,unset data model!"));
|
||||
|
||||
@@ -49,6 +49,7 @@ private:
|
||||
ULineEdit* mLeUserName;
|
||||
ULineEdit* mLeComment;
|
||||
ULineEdit* mLePwd;
|
||||
ULineEdit* mConfirmPwd;
|
||||
QToolButton* mBtnPwd;
|
||||
|
||||
QLabel* mLblError;
|
||||
|
||||
Reference in New Issue
Block a user