| 65 | } |
| 66 | |
| 67 | bool ConfigureDevicePage::validatePage() |
| 68 | { |
| 69 | QString portName = field("serialPort").toString(); |
| 70 | int baudRate = field("baudRate").toInt(); |
| 71 | if (field("isAdalight").toBool()) { |
| 72 | _transSettings->ledDevice.reset(new LedDeviceAdalight(portName, baudRate)); |
| 73 | } else if (field("isArdulight").toBool()){ |
| 74 | _transSettings->ledDevice.reset(new LedDeviceArdulight(portName, baudRate)); |
| 75 | } else { |
| 76 | QMessageBox::information(NULL, "Wrong device", "Try to restart the wizard"); |
| 77 | qCritical() << "couldn't create LedDevice, unexpected state, device is not selected or device is not configurable"; |
| 78 | return false; |
| 79 | } |
| 80 | _transSettings->ledDevice->setColorSequence(field("colorFormat").toString()); |
| 81 | _transSettings->ledDevice->open(); |
| 82 | |
| 83 | return true; |
| 84 | } |
| 85 | |
| 86 | int ConfigureDevicePage::nextId() { |
| 87 | if (QApplication::desktop()->screenCount() == 1) { |
nothing calls this directly
no test coverage detected