fix: filter out model specific sources in GFs
Following on from a discussion in #4104 about making it so that only sources that are not model specific are listed as valid sources, this PR aims to extend
isSourceAvailableInGlobalFunctions()
and lock down the available sources even more.
radio/src/gui/colorlcd/special_functions.cpp needs some work done do it also, so that functions such as
https://github.com/EdgeTX/edgetx/blob/172dfdebd8f1aab92e4fc67273bdf26b00a4e534/radio/src/gui/colorlcd/special_functions.cpp#L164
https://github.com/EdgeTX/edgetx/blob/172dfdebd8f1aab92e4fc67273bdf26b00a4e534/radio/src/gui/colorlcd/special_functions.cpp#L168
also filter their lists when in global context... i.e. similar to how B&W does for PLAY_VALUE (probably another function that needs it's setAvailableHandler massaged
https://github.com/EdgeTX/edgetx/blob/172dfdebd8f1aab92e4fc67273bdf26b00a4e534/radio/src/gui/128x64/model_special_functions.cpp#L343
Talk is cheap, so here is a PR to get the ball rolling 😉
For what it's worth, I don't agree that this is necessary.
If users want to use model sources in global functions they should be a able to.
If necessary the code should be made more robust and disable/ignore GF's where the source is not defined for the selected model.
Until something is done like that, really it is... if we have learnt anything from the recent crowdstrike incident, that is ;)
But, given this had been open for eight months now with no other comments, I am all ears for alternatives. IMO, though, rather than allow transient sources at the global level, instead we should be making it so you can share SFs, or even groups of SFs between models, thus invalidating any reason to allow this.
On Fri, 26 July 2024, 8:25 am philmoz, @.***> wrote:
For what it's worth, I don't agree that this is necessary.
If users want to use model sources in global functions they should be a able to.
If necessary the code should be made more robust and disable/ignore GF's where the source is not defined for the selected model.
— Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/pull/4333#issuecomment-2251502694, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ66KKK3GXDFOFHOEZCLSTZOF3ODAVCNFSM6AAAAABJF7ELPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRGUYDENRZGQ . You are receiving this because you authored the thread.Message ID: @.***>
Seems like I'm simply wasting my time here wanting the UI to only show valid sources.