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

More UI re-work plus warnings messages

parent e52a8e54
...@@ -36,70 +36,44 @@ Rectangle { ...@@ -36,70 +36,44 @@ Rectangle {
width: 10 width: 10
} }
/* Row {
FIXME: Leaving this in here for now for possible text usage in ui that does better job of describing firmware version spacing: 10
_ui->statusLog->setText(tr("WARNING: BETA FIRMWARE\n" ListModel {
- "This firmware version is ONLY intended for beta testers. " id: firmwareItems
- "Although it has received FLIGHT TESTING, it represents actively changed code. Do NOT use for normal operation.\n\n" ListElement {
- SELECT_FIRMWARE_LICENSE)); text: qsTr("Standard Version (stable)");
- break; firmwareType: FirmwareUpgradeController.StableFirmware
- }
- case 2: ListElement {
- _ui->statusLog->setText(tr("WARNING: CONTINUOUS BUILD FIRMWARE\n" text: qsTr("Beta Testing (beta)");
- "This firmware has NOT BEEN FLIGHT TESTED. " firmwareType: FirmwareUpgradeController.BetaFirmware
- "It is only intended for DEVELOPERS. Run bench tests without props first. " }
- "Do NOT fly this without addional safety precautions. Follow the mailing " ListElement {
- "list actively when using it.\n\n" text: qsTr("Developer Build (master)");
- SELECT_FIRMWARE_LICENSE)); firmwareType: FirmwareUpgradeController.DeveloperFirmware
*/ }
ListElement {
ExclusiveGroup { id: firmwareGroup } text: qsTr("Custom firmware file...");
firmwareType: FirmwareUpgradeController.CustomFirmware
QGCRadioButton { }
id: stableFirwareRadio
exclusiveGroup: firmwareGroup
text: qsTr("Standard Version (stable)")
checked: true
enabled: upgradeButton.enabled
onClicked: {
if (checked)
controller.firmwareType = FirmwareUpgradeController.StableFirmware
} }
}
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 { QGCComboBox {
// Just used as a spacer id: firmwareCombo
height: 20 width: 200
width: 10 height: upgradeButton.height
} model: firmwareItems
}
QGCButton { QGCButton {
id: upgradeButton id: upgradeButton
text: "UPGRADE" text: "UPGRADE"
onClicked: { primary: true
controller.doFirmwareUpgrade(); onClicked: {
controller.firmwareType = firmwareItems.get(firmwareCombo.currentIndex).firmwareType
controller.doFirmwareUpgrade();
}
} }
} }
......
...@@ -580,6 +580,27 @@ void FirmwareUpgradeController::_eraseProgressTick(void) ...@@ -580,6 +580,27 @@ void FirmwareUpgradeController::_eraseProgressTick(void)
void FirmwareUpgradeController::doFirmwareUpgrade(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); Q_ASSERT(_upgradeButton);
_upgradeButton->setEnabled(false); _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