-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdlgpassword.cpp
More file actions
51 lines (44 loc) · 982 Bytes
/
dlgpassword.cpp
File metadata and controls
51 lines (44 loc) · 982 Bytes
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
43
44
45
46
47
48
49
50
51
#include "dlgpassword.h"
#include "ui_dlgpassword.h"
#include "settings.h"
#include <QMessageBox>
DlgPassword::DlgPassword(QWidget *parent) :
QDialog(parent),
ui(new Ui::DlgPassword)
{
ui->setupUi(this);
ui->label->hide();
}
DlgPassword::~DlgPassword()
{
delete ui;
}
void DlgPassword::on_pushButtonOk_clicked()
{
Settings settings;
if (settings.chkPassword(ui->lineEditPassword->text()))
{
ui->label->hide();
password = ui->lineEditPassword->text();
accept();
}
else
{
ui->label->show();
}
}
void DlgPassword::on_pushButtonCancel_clicked()
{
reject();
}
void DlgPassword::on_pushButtonReset_clicked()
{
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Clear password?"));
msgBox.setText(tr("Warning, this will erase all secured account and credit card data."));
if (msgBox.exec() == QDialog::Accepted)
{
Settings settings;
settings.clearPassword();
}
}