}
bool MainWindow::verifyPassword() {
- bool ok;
+ bool incorrectPassword = false;
while (true) {
- PasswordDialog passwordDialog{this->walletName(), false, this};
+ PasswordDialog passwordDialog{this->walletName(), incorrectPassword, true, this};
int ret = passwordDialog.exec();
if (ret == QDialog::Rejected) {
return false;
}
if (passwordDialog.password != m_ctx->wallet->getPassword()) {
- QMessageBox::warning(this, "Error", "Incorrect password");
+ incorrectPassword = true;
continue;
}
break;
#include "utils/Icons.h"
-PasswordDialog::PasswordDialog(const QString &walletName, bool incorrectPassword, QWidget *parent)
+PasswordDialog::PasswordDialog(const QString &walletName, bool incorrectPassword, bool sensitive, QWidget *parent)
: WindowModalDialog(parent)
, ui(new Ui::PasswordDialog)
{
this->setWindowIcon(icons()->icon("appicons/64x64.png"));
ui->label_wallet->setText(QString("Please enter password for wallet: %1").arg(walletName));
ui->label_incorrectPassword->setVisible(incorrectPassword);
+ ui->label_sensitive->setVisible(sensitive);
connect(ui->buttonBox, &QDialogButtonBox::accepted, [this]{
password = ui->line_password->text();
Q_OBJECT
public:
- explicit PasswordDialog(const QString &walletName, bool incorrectPassword, QWidget *parent = nullptr);
+ explicit PasswordDialog(const QString &walletName, bool incorrectPassword, bool sensitive = false, QWidget *parent = nullptr);
~PasswordDialog() override;
QString password = "";
<x>0</x>
<y>0</y>
<width>832</width>
- <height>158</height>
+ <height>168</height>
</rect>
</property>
<property name="windowTitle">
<string>Password required</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_sensitive">
+ <property name="text">
+ <string>This dialog contains sensitive information.</string>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QLabel" name="label_wallet">
<property name="text">