mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-31 10:39:14 -04:00
Check both password edit fields.
This commit is contained in:
parent
1d23ed46e5
commit
7880c0e4f5
1 changed files with 16 additions and 1 deletions
|
@ -18,6 +18,8 @@
|
||||||
#include "ChangeMasterKeyWidget.h"
|
#include "ChangeMasterKeyWidget.h"
|
||||||
#include "ui_ChangeMasterKeyWidget.h"
|
#include "ui_ChangeMasterKeyWidget.h"
|
||||||
|
|
||||||
|
#include <QtGui/QMessageBox>
|
||||||
|
|
||||||
#include "keys/FileKey.h"
|
#include "keys/FileKey.h"
|
||||||
#include "keys/PasswordKey.h"
|
#include "keys/PasswordKey.h"
|
||||||
|
|
||||||
|
@ -61,8 +63,21 @@ void ChangeMasterKeyWidget::generateKey()
|
||||||
m_key.clear();
|
m_key.clear();
|
||||||
|
|
||||||
if (m_ui->passwordGroup->isChecked()) {
|
if (m_ui->passwordGroup->isChecked()) {
|
||||||
|
if (m_ui->enterPasswordEdit->text() == m_ui->repeatPasswordEdit->text()) {
|
||||||
|
if (m_ui->enterPasswordEdit->text().isEmpty()) {
|
||||||
|
if (QMessageBox::question(this, tr("Question"), tr("Do you really want to use an empty string as password?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text()));
|
m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text()));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::warning(this, tr("Error"), tr("Different passwords supplied."));
|
||||||
|
m_ui->enterPasswordEdit->setText("");
|
||||||
|
m_ui->repeatPasswordEdit->setText("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (m_ui->keyFileGroup->isChecked()) {
|
if (m_ui->keyFileGroup->isChecked()) {
|
||||||
FileKey fileKey;
|
FileKey fileKey;
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue