edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

Companion save update component asset options

Open elecpower opened this issue 2 years ago • 5 comments

Summary of changes:

  • enhances #2148
  • save customised update asset settings
  • manage settings via application settings Updates tab (i.e. move from Update dialog)
  • refactor interfacing with asset settings
  • some housekeeping
  • add delete decompress folders option independent to delete download folder option

elecpower avatar Sep 16 '22 12:09 elecpower

@pfeerick ready for you to play not so nicely with

PS I didn't add the rename feature you were seeking but maybe one day ;-)

elecpower avatar Sep 18 '22 13:09 elecpower

@pfeerick I'm in two minds about having 'this run' folder choices in the Process Options dialog so I would appreciate your thoughts. Auto update does not give you a chance to modify which IMO makes sense. Manual update initialises with saved settings. My thought was that if running manually you may wish to use a separate set of folders for the run as for example you maybe downloading a release candidate and do not want to update your day to day sd card for the profile. However you cannot change the asset settings.

elecpower avatar Sep 18 '22 20:09 elecpower

I see where you're coming from with this... And yes, if running manually since you have the choice of release/version from the dropdown lists, it would be handy to be able to override the root update folder if you want to grab a RC or something.

I think the part you don't like/aren't going to like is that you don't have options button for each component on a manual run, which would use the saved setting by default, but allow changing of the settings for that run only also... While I sort of feel that's going too far, but at the same time, if, for instance, a future release changes something - i.e. the MPM firmware changes naming convention, ETX changes some naming convention, which means a filter needs to change for a future release/nightly/rc... it actually becomes a necessary complexity - as otherwise, the default filters will filter stuff out wrongly. If there is no reason to change them, you just don't press the button and change stuff. If you want to get really fancy, you have a 'save as default' button in the dialogs there also so they do get saved as permanent settings.

In other words, the folder option is good. But probably need to go the whole hog and allow for run(time) options - whether now or later is entirely up to you... this is looking pretty good as it is now. If you want me to break stuff, well, with this ticked - the post update SD sync still wanted to sync with the underlying C:/Users/pfeer/Documents/EdgeTX/updates (i.e. the path when not ticked) - it looks to be following the main "Update Settings" tab option ... but that is the only thing that has tried to trick me or misbehave so far.

image

pfeerick avatar Sep 19 '22 03:09 pfeerick

Your response is not unexpected because I was leaning that way too as this implementation seemed a half way house. But thought I would get a second opinion before heading down that track. At least the asset options dialog can be called from both places as I left it independent when moved to update settings. Just need it to be aware where it is called from.

I'll have a look at the sd sync.

elecpower avatar Sep 19 '22 04:09 elecpower

@pfeerick latest changes:

  • sd sync local folder matches update folder
  • all update runtime parameters can be saved as defaults
  • release channel can be changed at runtime
  • housekeeping

Ready for you to road test

elecpower avatar Sep 22 '22 11:09 elecpower

I gave this a spin last night... everything seems to be working as expected, and straightforward enough to use. Nicely done!! :)

pfeerick avatar Sep 25 '22 22:09 pfeerick

hi @elecpower and @pfeerick , I have found a bug, when you translate oneof Companion, Voices, Firmware etc the function UpdateInterface::setSettingsIndex fails with a corrupt variable "name". To get the bug try....

Translate in language file, fx section UpdateSounds and Source "Sounds" and tranlate to "Lyde". Change the function to:

void UpdateInterface::setSettingsIndex()
{
  char s[100];                                         // TEST
  int i = g.getComponentIndex(name);

  if (i < 0) {
    for (i = 0; i < MAX_COMPONENTS && g.component[i].existsOnDisk(); i++)
      ;
    sprintf( s, "%s: .%d.", name, i);          // TEST
      
    if (i >= MAX_COMPONENTS) {
      reportProgress(s, QtCriticalMsg);  // TEST
      reportProgress(tr("No free slot to save interface settings!"), QtCriticalMsg);
      i = -1;
    }
    else {
      g.component[i].init();
      g.component[i].name(name);
    }
  }

HThuren avatar Oct 17 '22 16:10 HThuren