mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-03 09:29:37 +00:00
PasswordDialog: UI improvements
This commit is contained in:
parent
6633353bf3
commit
ef5f831013
4 changed files with 14 additions and 6 deletions
|
@ -1627,15 +1627,15 @@ void MainWindow::updateRecentlyOpenedMenu() {
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#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)
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ PasswordDialog::PasswordDialog(const QString &walletName, bool incorrectPassword
|
|||
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();
|
||||
|
|
|
@ -17,7 +17,7 @@ class PasswordDialog : public WindowModalDialog
|
|||
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 = "";
|
||||
|
|
|
@ -7,13 +7,20 @@
|
|||
<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">
|
||||
|
|
Loading…
Reference in a new issue