Option to define model notes file name from model setup (#1396) - #1441
Option to define model notes file name from model setup (#1396)#1441eshifri wants to merge 8 commits into
Conversation
|
Changes to Companion required otherwise the setting will be lost and also need to edit |
|
@elecpower Can you be more specific, please? I tested it on simulator and the file name was saved in modelXX.yml. I did not try copy from Companion to TX though. |
|
@eshifri - if the setting is not present in the companion - it will not be displayed and probably would be lost when transferring settings from companion to radio. |
@eshifri, @piotrva is correct. Companion needs to be made aware of every field in the yml files otherwise it:
|
|
I see. Thank you! |
|
@elecpower Can you please take a look at the last commit? |
|
Reason: as you are using Qt default signals and slots, the field name part of the slot name must match exactly the field name in the ui definition along with the event signal. For code consistency can you please use camel case and no underscores exception when using Qt's default slot names. Also ui field label names are okay to default to Qt Designer auto generated if not referenced in code otherwise preferable to use ui edit field name and append Lbl. This makes it easier for future maintenance to identify the pair in the code and ui definition. There are numerous exceptions that have been created over time and it makes my life challenging. Get back to me if this doesn't make sense or you need some more help. |
|
Thank you @elecpower , but this is a little bit above my knowledge level. The part I do not understand is "field name part of the slot name must match exactly the field name in the ui definition along with the event signal". Thank you for the help; much appreciated. |
|
Yes |
|
Many thanks to @elecpower for pointing the solution! |
1dad067 to
70151bb
Compare
|
I've finally caught up with rebasing this PR... (hopefully didn't screw something up there... it was a fun one) as it had several conflicts due to changes to companion UI code and yaml data structs, etc. From a quick test on the TX16S, it seems fine... I'll play a little more with that but don't expect to find any breakage. Then onto B&W and syncing with companion. @elecpower I made a change (last commit) around populating the filename line-edit field with either configured value or if that is not present, the model name, but I couldn't figure out how to connect the model |
|
@pfeerick The original implementation fro Companion assumed that the file exists and can be just selected. If you allow to enter a non-existing name, some new problems may suffice. |
|
@pfeerick I'll have a look |
|
@pfeerick need to trigger update of notesFile from on_name_editingFinished. However I assume we would not want to update the notesFile if it wasn't blank and not the same as the name field before the name field was updated. An additional enhancement to this PR could be to have the ability to browse the profile sd card for checklist/notes files and handle the configured one not existing such as when the sd card hasn't been synced with the radio like is done for model image ;-) |
Checked and if it doesn't exist Companion will create then it comes down to syncing profile sd card with radio. |
|
Closed by mistake |
cc3a873 to
5493fb9
Compare
@elecpower Coming back to this PR now... I see what you mean with the If the QInput field was changed to a combo box similar to the model image browser, and the first entry was ... 'Default' (and used the model name) ... would that be better? After all, on the radio, you can only pick from the list on it also, so it's not like you can enter a name there. |
|
@pfeerick I'll refresh my memory on this one and advise |
|
Ok, thanks. I'll revisit this on the weekend. My thoughts on this after mulling it over is that the combobox default (index 0) would reflect the name of the model name as it is entered, and would dynamically update if the name is change, thus reflecting the filename the radio will be looking for. If the user chooses any other entry, well, naturally the file choosen via the file browser capability is used. |
|
We can also add an option to assign the notes file from the Radio Setup->SDcard->file menu simo;ar to the image file. So the user can look into the content first. |
|
Good point, that would be nice to have also... :) Also some people may want to use the SD browser instead of via the model settings... |
|
Will be rebased? |
|
Deleted by mistake. |
|
Reopen |
|
Don't worry about the rebase, that will be my problem once 2.8.0 is safely on it's way ;) This will happen, was just pushed to 2.9 because there are never enough hours in the day to play with the stuff you want to. 😢 |
|
This one and custom warning are most requested from my side, so I am looking forward to test them once they will be in 2.9 nightly :) |
Implements #1396
Summary of changes: Added option to define model notes file from the model setup screen.
If the file is defined it is used.
If it is not defined - modelName.txt is used.
If this is not present - modelXX.txt is used.
Changes for YAML storage and translations are done.
Tested on TX16S and NV14 for color LCD and on simulator for X9d+ and X7.