summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorIntegral <integral@member.fsf.org>2024-05-19 13:25:18 -0700
committerIntegral <integral@member.fsf.org>2024-05-19 13:25:18 -0700
commit1ab3a37056769fc578f90ae9f0a1e5b1e18638d7 (patch)
tree0df39aed5a3827495519d6a229268a209cdc6a80 /src
parentBump mtxclient for better mentions support on older servers (diff)
downloadnheko-1ab3a37056769fc578f90ae9f0a1e5b1e18638d7.tar.xz
Add dialog for repeating password when exporting keys
Diffstat (limited to 'src')
-rw-r--r--src/UserSettingsPage.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp
index 49fb6a59..0ba2386c 100644
--- a/src/UserSettingsPage.cpp
+++ b/src/UserSettingsPage.cpp
@@ -2127,11 +2127,25 @@ UserSettingsModel::exportSessionKeys()
     if (!ok)
         return;
 
+    auto repeatedPassword = QInputDialog::getText(nullptr,
+                                                  tr("Repeat File Password"),
+                                                  tr("Repeat the passphrase:"),
+                                                  QLineEdit::Password,
+                                                  QLatin1String(""),
+                                                  &ok);
+    if (!ok)
+        return;
+
     if (password.isEmpty()) {
         QMessageBox::warning(nullptr, tr("Error"), tr("The password cannot be empty"));
         return;
     }
 
+    if (password != repeatedPassword) {
+        QMessageBox::warning(nullptr, tr("Error"), tr("Passwords don't match"));
+        return;
+    }
+
     // Open file dialog to save the file.
     const QString homeFolder = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
     const QString fileName   = QFileDialog::getSaveFileName(