-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheditkeydialog.cpp
42 lines (38 loc) · 990 Bytes
/
editkeydialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "editkeydialog.h"
#include "ui_editkeydialog.h"
#include "QMessageBox"
EditKeyDialog::EditKeyDialog(QWidget *parent,const QString &userName) :
QDialog(parent),
ui(new Ui::EditKeyDialog)
{
ui->setupUi(this);
currUserName = userName;
}
EditKeyDialog::~EditKeyDialog()
{
delete ui;
}
void EditKeyDialog::on_OKButton_clicked()
{
QString oldKey = ui->oldKeyLineEdit->text();
if(Global::UserMag->verifyPsw(currUserName,oldKey))
{
if(ui->newKeyLineEdit->text() == ui->sureKeyLineEdit->text())
{
Global::UserMag->updatePassword(currUserName,ui->newKeyLineEdit->text());
QDialog::accept();
}
else
{
QMessageBox::warning(this, tr("错误"), tr("密码不一致(注意大小写),请重新输入."));
}
}
else
{
QMessageBox::warning(this, tr("错误"), tr("密码错误(注意大小写),请重新输入."));
}
}
void EditKeyDialog::on_quitButton_clicked()
{
QDialog::close();
}