Commit 5e5124b1 authored by Don Gagne's avatar Don Gagne

More UI re-work plus warnings messages

parent e52a8e54
......@@ -36,70 +36,44 @@ Rectangle {
width: 10
}
/*
FIXME: Leaving this in here for now for possible text usage in ui that does better job of describing firmware version
_ui->statusLog->setText(tr("WARNING: BETA FIRMWARE\n"
- "This firmware version is ONLY intended for beta testers. "
- "Although it has received FLIGHT TESTING, it represents actively changed code. Do NOT use for normal operation.\n\n"
- SELECT_FIRMWARE_LICENSE));
- break;
-
- case 2:
- _ui->statusLog->setText(tr("WARNING: CONTINUOUS BUILD FIRMWARE\n"
- "This firmware has NOT BEEN FLIGHT TESTED. "
- "It is only intended for DEVELOPERS. Run bench tests without props first. "
- "Do NOT fly this without addional safety precautions. Follow the mailing "
- "list actively when using it.\n\n"
- SELECT_FIRMWARE_LICENSE));
*/
ExclusiveGroup { id: firmwareGroup }
QGCRadioButton {
id: stableFirwareRadio
exclusiveGroup: firmwareGroup
text: qsTr("Standard Version (stable)")
checked: true
enabled: upgradeButton.enabled
onClicked: {
if (checked)
controller.firmwareType = FirmwareUpgradeController.StableFirmware
Row {
spacing: 10
ListModel {
id: firmwareItems
ListElement {
text: qsTr("Standard Version (stable)");
firmwareType: FirmwareUpgradeController.StableFirmware
}
ListElement {
text: qsTr("Beta Testing (beta)");
firmwareType: FirmwareUpgradeController.BetaFirmware
}
ListElement {
text: qsTr("Developer Build (master)");
firmwareType: FirmwareUpgradeController.DeveloperFirmware
}
ListElement {
text: qsTr("Custom firmware file...");
firmwareType: FirmwareUpgradeController.CustomFirmware
}
}
}
QGCRadioButton {
id: betaFirwareRadio
exclusiveGroup: firmwareGroup
text: qsTr("Beta Testing (beta)")
enabled: upgradeButton.enabled
onClicked: { if (checked) controller.firmwareType = FirmwareUpgradeController.BetaFirmware }
}
QGCRadioButton {
id: devloperFirwareRadio
exclusiveGroup: firmwareGroup
text: qsTr("Developer Build (master)")
enabled: upgradeButton.enabled
onClicked: { if (checked) controller.firmwareType = FirmwareUpgradeController.DeveloperFirmware }
}
QGCRadioButton {
id: customFirwareRadio
exclusiveGroup: firmwareGroup
text: qsTr("Custom firmware file...")
enabled: upgradeButton.enabled
onClicked: { if (checked) controller.firmwareType = FirmwareUpgradeController.CustomFirmware }
}
Item {
// Just used as a spacer
height: 20
width: 10
}
QGCComboBox {
id: firmwareCombo
width: 200
height: upgradeButton.height
model: firmwareItems
}
QGCButton {
id: upgradeButton
text: "UPGRADE"
onClicked: {
controller.doFirmwareUpgrade();
QGCButton {
id: upgradeButton
text: "UPGRADE"
primary: true
onClicked: {
controller.firmwareType = firmwareItems.get(firmwareCombo.currentIndex).firmwareType
controller.doFirmwareUpgrade();
}
}
}
......
......@@ -580,6 +580,27 @@ void FirmwareUpgradeController::_eraseProgressTick(void)
void FirmwareUpgradeController::doFirmwareUpgrade(void)
{
QString warningMsg;
if (_firmwareType == BetaFirmware) {
warningMsg = tr("WARNING: BETA FIRMWARE\n"
"This firmware version is ONLY intended for beta testers. "
"Although it has received FLIGHT TESTING, it represents actively changed code. Do NOT use for normal operation.\n\n"
"Are you sure you want to continue?");
} else if (_firmwareType == DeveloperFirmware) {
warningMsg = tr("WARNING: CONTINUOUS BUILD FIRMWARE\n"
"This firmware has NOT BEEN FLIGHT TESTED. "
"It is only intended for DEVELOPERS. Run bench tests without props first. "
"Do NOT fly this without addional safety precautions. Follow the mailing "
"list actively when using it.\n\n"
"Are you sure you want to continue?");
}
if (!warningMsg.isEmpty()) {
if (QGCMessageBox::warning(tr("Firmware Upgrade"), warningMsg, QGCMessageBox::Yes | QGCMessageBox::No, QGCMessageBox::No) == QGCMessageBox::No) {
return;
}
}
Q_ASSERT(_upgradeButton);
_upgradeButton->setEnabled(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment