From 3dc4a9471577ad1939d242b15be66bd8eeabe863 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 6 Oct 2022 08:39:26 +0200 Subject: [PATCH] fix(color): Changes to widget options not always being saved (#2475) * fixes issue https://github.com/EdgeTX/edgetx/issues where a change of the source value in widget settings was not written back to the model .yml file. * fixes https://github.com/EdgeTX/edgetx/pull/2475 extended force write to .yml to all widget settings option types * fixes issue https://github.com/EdgeTX/edgetx/issues/2465 where a change of the source value in widget settings was not written back to the model .yml file. * https://github.com/EdgeTX/edgetx/issues/2465 extended force write to .yml to all widget settings option types * removed unnecessary SET_DIRTY() for ModelTextEdit() as it is already handled by ModelTextEdit() changed indent for SET_DIRTY() in lambda for Choice() * removed unnecessary SET_DIRTY() for ModelTextEdit() as it is already handled by ModelTextEdit() changed indent for SET_DIRTY() in lambda for Choice() --- radio/src/gui/colorlcd/widget_settings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radio/src/gui/colorlcd/widget_settings.cpp b/radio/src/gui/colorlcd/widget_settings.cpp index 5465a7730..c7054b5bf 100644 --- a/radio/src/gui/colorlcd/widget_settings.cpp +++ b/radio/src/gui/colorlcd/widget_settings.cpp @@ -69,6 +69,7 @@ WidgetSettings::WidgetSettings(Window* parent, Widget* widget) : }, [=](int32_t newValue) { widget->getOptionValue(optIdx)->signedValue = newValue; + SET_DIRTY(); }); break; @@ -81,6 +82,7 @@ WidgetSettings::WidgetSettings(Window* parent, Widget* widget) : [=](int16_t newValue) { widget->getOptionValue(optIdx)->unsignedValue = (uint32_t)newValue; + SET_DIRTY(); }); break; @@ -128,6 +130,7 @@ WidgetSettings::WidgetSettings(Window* parent, Widget* widget) : [=](int newValue) { // setValue widget->getOptionValue(optIdx)->unsignedValue = (uint32_t)newValue; + SET_DIRTY(); }); tmChoice->setTextHandler([](int value) { @@ -146,6 +149,7 @@ WidgetSettings::WidgetSettings(Window* parent, Widget* widget) : [=](int16_t newValue) { // setValue widget->getOptionValue(optIdx)->unsignedValue = (uint32_t)newValue; + SET_DIRTY(); }); break;