]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
wizard: don't allow illegal chars in wallet name
authortobtoht <tob@featherwallet.org>
Fri, 3 May 2024 21:23:15 +0000 (23:23 +0200)
committertobtoht <tob@featherwallet.org>
Fri, 3 May 2024 21:23:15 +0000 (23:23 +0200)
src/wizard/PageWalletFile.cpp

index c8a78d859f0d014619ebba24f3c783d00b50086b..0f5bae4a22cdf3f2d6dc6ce5a729f2a10a2780ff 100644 (file)
@@ -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);