From 35a3cff250d94dfc276d5fdffa4cb71739c25d17 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Wed, 30 Oct 2019 16:28:30 -0700 Subject: [PATCH] Don't accept empty passwords --- src/mainwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ca424cf..6143aeb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -225,7 +225,7 @@ void MainWindow::encryptWallet() { auto encStatus = rpc->getModel()->getEncryptionStatus(); if (encStatus.first) { QMessageBox::information(this, tr("Wallet is already encrypted"), - tr("Your wallet is already encrypted with a password.\nPlease use 'Remove Wallet Encryption if you want to remove the wallet encryption."), + tr("Your wallet is already encrypted with a password.\nPlease use 'Remove Wallet Encryption' if you want to remove the wallet encryption."), QMessageBox::Ok ); return; @@ -248,11 +248,12 @@ void MainWindow::encryptWallet() { } }; - ed.txtPassword->setText(""); - QObject::connect(ed.txtConfirmPassword, &QLineEdit::textChanged, fnPasswordEdited); QObject::connect(ed.txtPassword, &QLineEdit::textChanged, fnPasswordEdited); + ed.txtPassword->setText(""); + ed.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + auto fnShowError = [=](QString title, const json& res) { QMessageBox::critical(this, title, tr("Error was:\n") + QString::fromStdString(res.dump()),