fix(cpn): radio specific name and label validators (#4670)

Only allows valid characters in names, drops invalid characters if present
This commit is contained in:
Neil Horne
2024-02-28 11:35:57 +10:00
committed by GitHub
parent 3807d7759b
commit 57c7aca2f6
31 changed files with 428 additions and 139 deletions
+2 -2
View File
@@ -23,6 +23,7 @@
#include "compounditemmodels.h"
#include "filtereditemmodels.h"
#include "autocombobox.h"
#include "namevalidator.h"
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
@@ -287,8 +288,7 @@ ui(new Ui::GeneralSetup)
ui->pwrOnDelay->hide();
}
QRegExp rx(CHAR_FOR_NAMES_REGEX);
ui->registrationId->setValidator(new QRegExpValidator(rx, this));
ui->registrationId->setValidator(new NameValidator(board, this));
ui->registrationId->setMaxLength(REGISTRATION_ID_LEN);
setValues();