From 5511cd13d75f660104de7cc5ac29f676f8ed789e Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Tue, 11 Jul 2023 23:57:16 +1200 Subject: [PATCH] Add forcedFirmwareUpgradeSupported to supportedDivecomputers. Signed-off-by: Michael Keller --- desktop-widgets/configuredivecomputerdialog.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp index 12f665da8..da916be7f 100644 --- a/desktop-widgets/configuredivecomputerdialog.cpp +++ b/desktop-widgets/configuredivecomputerdialog.cpp @@ -104,16 +104,17 @@ struct DiveComputerEntry { QString product; unsigned int transport; bool fwUpgradePossible; + bool forcedFirmwareUpgradeSupported; }; //WARNING: Do not edit this list or even just change its order without // making corresponding changes to the `DiveComputerList` element // in `configuredivecomputerdialog.ui` or this functionality will stop working. static const DiveComputerEntry supportedDiveComputers[] = { - { "Heinrichs Weikamp", "OSTC 2N", DC_TRANSPORT_SERIAL, true }, - { "Heinrichs Weikamp", "OSTC Plus", DC_TRANSPORT_BLUETOOTH, true }, - { "Heinrichs Weikamp", "OSTC 4", DC_TRANSPORT_BLUETOOTH, true }, - { "Suunto", "Vyper", DC_TRANSPORT_SERIAL, false }, + { "Heinrichs Weikamp", "OSTC 2N", DC_TRANSPORT_SERIAL, true, false }, + { "Heinrichs Weikamp", "OSTC Plus", DC_TRANSPORT_BLUETOOTH, true, false }, + { "Heinrichs Weikamp", "OSTC 4", DC_TRANSPORT_BLUETOOTH, true, true }, + { "Suunto", "Vyper", DC_TRANSPORT_SERIAL, false, false }, }; ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) : QDialog(parent), @@ -1538,7 +1539,7 @@ void ConfigureDiveComputerDialog::dc_open() const DiveComputerEntry selectedDiveComputer = supportedDiveComputers[ui.DiveComputerList->currentRow()]; ui.updateFirmwareButton->setEnabled(selectedDiveComputer.fwUpgradePossible); - ui.forceUpdateFirmware->setEnabled(supportedDiveComputers[selectedDiveComputerIndex].product == "OSTC 4"); + ui.forceUpdateFirmware->setEnabled(selectedDiveComputer.forcedFirmwareUpgradeSupported); ui.progressBar->setFormat(tr("Connected to device"));