From: tobtoht Date: Fri, 3 May 2024 21:23:15 +0000 (+0200) Subject: wizard: don't allow illegal chars in wallet name X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=87ee96cb9a9e8d95d8724803630549ba4d672933;p=gamesguru%2Ffeather.git wizard: don't allow illegal chars in wallet name --- diff --git a/src/wizard/PageWalletFile.cpp b/src/wizard/PageWalletFile.cpp index c8a78d85..0f5bae4a 100644 --- a/src/wizard/PageWalletFile.cpp +++ b/src/wizard/PageWalletFile.cpp @@ -20,6 +20,10 @@ PageWalletFile::PageWalletFile(WizardFields *fields, QWidget *parent) ui->frame_wallet->setInfo(icons()->icon("file"), "Choose a name and directory for your wallet files."); + QRegularExpression nameRe(R"([^\/\\:*?"<>|]+)"); + QValidator *nameValidator = new QRegularExpressionValidator(nameRe, this); + ui->line_walletName->setValidator(nameValidator); + connect(ui->btnChange, &QPushButton::clicked, [=] { QString currentWalletDir = conf()->get(Config::walletDirectory).toString(); QString walletDir = QFileDialog::getExistingDirectory(this, "Select wallet directory ", currentWalletDir, QFileDialog::ShowDirsOnly);