Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with loading of OnHold and OnLongRelease config in OUTPUT #1718

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

Koseng
Copy link
Contributor

@Koseng Koseng commented Feb 25, 2024

fixes #1689
Since syncFromConfig handles also null input and the whole config is cloned on opening the wizard, the previous code was unecessary and missed the new button config parameters.

I don't understand why new AnalogInputConfig and ButtonInputConfig objects were created. First I wanted to clone the config instead of assigning single parameters, but then I thought why cloning at all?

Copy link

Build for this pull request:
MobiFlightConnector.zip

@DocMoebiuz
Copy link
Collaborator

fixes #1689 Since syncFromConfig handles also null input and the whole config is cloned on opening the wizard, the previous code was unecessary and missed the new button config parameters.

I don't understand why new AnalogInputConfig and ButtonInputConfig objects were created. First I wanted to clone the config instead of assigning single parameters, but then I thought why cloning at all?

we clone the configs ALWAYS inside the config wizards to make sure that any change made inside the WIzard does not affect the original item. So when you click cancel then we can assure that the original item was not changed. Also it helps us to determine whether anything was changed and if we need to mark the config file as "modified" to enable/disable the save-button in the menu bar accordingly.

@DocMoebiuz DocMoebiuz merged commit 3832818 into MobiFlight:main Feb 26, 2024
1 check passed
@DocMoebiuz DocMoebiuz added the bug Something isn't working in a officially released version label Feb 26, 2024
@Koseng
Copy link
Contributor Author

Koseng commented Feb 27, 2024

fixes #1689 Since syncFromConfig handles also null input and the whole config is cloned on opening the wizard, the previous code was unecessary and missed the new button config parameters.
I don't understand why new AnalogInputConfig and ButtonInputConfig objects were created. First I wanted to clone the config instead of assigning single parameters, but then I thought why cloning at all?

we clone the configs ALWAYS inside the config wizards to make sure that any change made inside the WIzard does not affect the original item. So when you click cancel then we can assure that the original item was not changed. Also it helps us to determine whether anything was changed and if we need to mark the config file as "modified" to enable/disable the save-button in the menu bar accordingly.

Yeah, that is clear. What I did not understand was, since the behavior is as described, why there was an additional copy of the ButtonConfig in the previous code. So first the clone, then an additional copy, which I removed.

@DocMoebiuz
Copy link
Collaborator

i think that was by accident - i think i added the proper cloning just recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in a officially released version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with On Hold and On Long Release tabs in OUTPUT / Display / Input Action
2 participants