Open samuelfmlourenco opened 2 weeks ago
To fix this issue, two changes will have to be made to "configuratorwindow.cpp" and "configuratorwindow.h", including a new function:
void ConfiguratorWindow::on_lineEditSerial_textChanged()
{
if (ui->lineEditSerial->text().isEmpty()) {
ui->lineEditSerial->setStyleSheet("background: rgb(255, 204, 0);");
} else {
ui->lineEditSerial->setStyleSheet("");
}
}
Furthermore, showInvalidInput() has to accomodate the new check, as shown below:
bool ConfiguratorWindow::showInvalidInput()
{
bool retval = false;
if (ui->lineEditSerial->text().isEmpty()) { // Verification added in version 3.0
ui->lineEditSerial->setStyleSheet("background: rgb(255, 102, 102);");
retval = true;
}
...
return retval;
}
The application currently allows a zero-length serial number to be written. However, that invalidates the CP2130 device, making it unusable. Therefore, the application must check if the "Serial number" line edit box is not empty before writing the configuration to the device.