-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathchangepassdialog.cpp
More file actions
37 lines (35 loc) · 1.29 KB
/
changepassdialog.cpp
File metadata and controls
37 lines (35 loc) · 1.29 KB
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
#include "changepassdialog.h"
#include "ui_changepassdialog.h"
ChangePassDialog::ChangePassDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::ChangePassDialog)
{
ui->setupUi(this);
connect(ui->btnSave, SIGNAL(clicked()), this, SLOT(checkPasses()));
connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
this->setWindowTitle("pCloud Drive");
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); // to have min size for diff OSs
this->layout()->setSizeConstraint(QLayout::SetFixedSize); //not resized
}
ChangePassDialog::~ChangePassDialog()
{
delete ui;
}
void ChangePassDialog::checkPasses()
{
if (ui->line_newpass->text() != ui->line_newpass2->text())
{
//QMessageBox::information(this,trUtf8("New password"), trUtf8("New passwords do not match"));
QMessageBox::warning(this,trUtf8("New password"), trUtf8("New passwords do not match"));
return;
}
if(ui->line_newpass->text().length() < 6)
{
QMessageBox::warning(this,trUtf8("New password"), trUtf8("New passwords should consist of at least six symbols"));
ui->line_newpass->setFocus();
return;
}
else
this->accept();
}