mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-21 18:50:47 +03:00
Add dialog for repeating password when exporting keys
This commit is contained in:
parent
f3c8fb089a
commit
1ab3a37056
1 changed files with 14 additions and 0 deletions
|
@ -2127,11 +2127,25 @@ UserSettingsModel::exportSessionKeys()
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auto repeatedPassword = QInputDialog::getText(nullptr,
|
||||||
|
tr("Repeat File Password"),
|
||||||
|
tr("Repeat the passphrase:"),
|
||||||
|
QLineEdit::Password,
|
||||||
|
QLatin1String(""),
|
||||||
|
&ok);
|
||||||
|
if (!ok)
|
||||||
|
return;
|
||||||
|
|
||||||
if (password.isEmpty()) {
|
if (password.isEmpty()) {
|
||||||
QMessageBox::warning(nullptr, tr("Error"), tr("The password cannot be empty"));
|
QMessageBox::warning(nullptr, tr("Error"), tr("The password cannot be empty"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (password != repeatedPassword) {
|
||||||
|
QMessageBox::warning(nullptr, tr("Error"), tr("Passwords don't match"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Open file dialog to save the file.
|
// Open file dialog to save the file.
|
||||||
const QString homeFolder = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
const QString homeFolder = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||||
const QString fileName = QFileDialog::getSaveFileName(
|
const QString fileName = QFileDialog::getSaveFileName(
|
||||||
|
|
Loading…
Reference in a new issue