fix(cpn): ACCESS owner registration id validation (#2687)

* fix(cpn): ACCESS owner registration id validation (#2672)

* Allow registration id for internal ISRM module

* Always display owner id
This commit is contained in:
Neil Horne
2022-12-10 15:16:58 +10:00
committed by GitHub
parent 1860233fb5
commit 2a882c8499
2 changed files with 6 additions and 9 deletions
+5 -5
View File
@@ -275,6 +275,10 @@ ui(new Ui::GeneralSetup)
ui->pwrOnDelay->hide();
}
QRegExp rx(CHAR_FOR_NAMES_REGEX);
ui->registrationId->setValidator(new QRegExpValidator(rx, this));
ui->registrationId->setMaxLength(REGISTRATION_ID_LEN);
setValues();
lock = false;
@@ -460,7 +464,6 @@ void GeneralSetupPanel::setValues()
ui->pwrOnDelay->setValue(2 - generalSettings.pwrOnSpeed);
ui->pwrOffDelay->setValue(2 - generalSettings.pwrOffSpeed);
// TODO: only if ACCESS available??
ui->registrationId->setText(generalSettings.registrationId);
}
@@ -781,10 +784,7 @@ void GeneralSetupPanel::on_blAlarm_ChkB_stateChanged()
void GeneralSetupPanel::on_registrationId_editingFinished()
{
//copy ownerID back to generalSettings.registrationId
QByteArray array = ui->registrationId->text().toLocal8Bit();
strncpy(generalSettings.registrationId, array, 8);
generalSettings.registrationId[8] = '\0';
strncpy(generalSettings.registrationId, ui->registrationId->text().toLatin1(), REGISTRATION_ID_LEN);
emit modified();
}
+1 -4
View File
@@ -733,9 +733,6 @@
</item>
<item row="20" column="1">
<widget class="QLineEdit" name="registrationId">
<property name="inputMask">
<string>nnnnnnNN</string>
</property>
<property name="maxLength">
<number>8</number>
</property>
@@ -1046,7 +1043,7 @@
</layout>
</item>
<item row="20" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="label_registrationId">
<property name="text">
<string>Owner Registration ID</string>
</property>