Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[Companion] Radio conversion improvements #5534
The goal here is twofold: 1) Provide better conversion and validation of new settings, and 2) inform the user what exactly was done and (especially) what couldn't be converted properly. Related: #4264
I added a rudimentary conversion state tracker/logger class which accumulates conversion details throughout the process and afterwards can return a full log of events. This state is passed around between the conversion functions of the various modules.
After conversion, if any messages are generated then the log data is presented in a table view dialog which I enhanced to provide text and HTML export functions (clipboard copy or save to file). The dialog is modeless so you can keep it open while looking at the converted models. Errors (e.g. missing hardware controls) are highlighted in red, conversions (e.g. SE->SG) in orange, and "adjustments" (e.g. X9 SF -> X7 SF) in black. Suggestions to improve the wording or presentation here are welcome.
Since the state tracker keeps a copy of the old radio data, we could theoretically launch model compare after conversion, or other ideas. That will need some UI work since obviously we don't want to launch a bunch of compare windows at the same time or if user isn't interested. Thoughts for later.
I also spent some time making sure conversions can't happen by accident on an unsaved file (if switching radio type user is prompted to save or cancel), and letting the user opt-out of conversion altogether. The system will detect if you're changing radio type via either a profile switch or when editing profile settings. It also will not let you delete the active profile if you have unsaved file changes.
And finally the conversion process itself got some additions and fixes:
Diffs should be easier to absorb per-commit vs. all at once... I tried to break them up logically.
This will conflict a little with my other open PR #5437, so I will need to rebase after that is merged (already tested), or vice versa.
"Extreme" example converting a couple X12 radio files to X7: