Add dialog for repeating password when exporting keys

pull/1734/head
Integral 9 months ago
parent f3c8fb089a
commit 1ab3a37056
No known key found for this signature in database
GPG Key ID: 06313911057DD5A8
  1. 14
      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(

Loading…
Cancel
Save