]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
PasswordDialog: UI improvements
authortobtoht <thotbot@protonmail.com>
Fri, 27 May 2022 09:49:32 +0000 (11:49 +0200)
committertobtoht <thotbot@protonmail.com>
Fri, 27 May 2022 09:49:32 +0000 (11:49 +0200)
src/MainWindow.cpp
src/dialog/PasswordDialog.cpp
src/dialog/PasswordDialog.h
src/dialog/PasswordDialog.ui

index 7d7db041d34ac9f64fac2bbff540a3835aeb5c47..edbfd179227229bf793633de35324d59446eacbd 100644 (file)
@@ -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;
index 7465166cee62c54ac03d901699e16d7052df7283..42417f1b45beb59731e86c4abc0e37b8d393f7a5 100644 (file)
@@ -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();
index 78d82b935684f489c6f90a0f1d3fe342e4fe0940..73fc746a29937814888b8bf00c220596985b3c34 100644 (file)
@@ -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 = "";
index 1ef82e54e23537e9fd7da8547e265ac8c9208891..41b949baf2e08e92840cd064b64c12326b350a64 100644 (file)
@@ -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">