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

Add control to Video Player to select among several Meter Widget layouts #3515

Merged

Conversation

michelrdagenais
Copy link
Contributor

The video layout file is extended to contain possibly several named layouts. The file is read to list the layouts and offer a selection in the Video Player chart settings menu. The file is then read again to
instantiate the selected layout.

This was a suggestion of Alejandro Martinez. Interestingly, you can edit the settings and change the layout of the Video Viewer even while the training session is underway. You can add a video viewer as well while the training session is running. Your video layout choice is saved in your training layout. A video-layout.xml resource file is provided with 3 different layouts if you want to test it (move elsewhere your current ~/.goldencheetah/User/config/video-layout.xml and the new file will automatically be provided as default the next time you use a video viewer). The provided "Text Widget" layout does not look too good currently but should be nice with the Meter Widget enhancements pull request that I proposed a few days ago.

The video layout file is extended to contain possibly several named
layouts. The file is read to list the layouts and offer a selection in
the Video Player chart settings menu. The file is then read again to
instantiate the selected layout.
@amtriathlon amtriathlon added this to the 3.6 milestone Jun 20, 2020
@amtriathlon amtriathlon merged commit 05e89e5 into GoldenCheetah:master Jun 20, 2020
@amtriathlon
Copy link
Member

Thanks Michel, I merged this first so the others we have pending can be adapted.
A nice addition would be a "Reset to Default" button to remove config/video-layout.xml and load the default, mainly oriented to users not comfortable with config files who just want to use the newest layout.

@michelrdagenais
Copy link
Contributor Author

Thanks Michel, I merged this first so the others we have pending can be adapted.

I will udate the TextMeterWidgetEnhancements. The ControllerSetWeight patch is not impacted.

A nice addition would be a "Reset to Default" button to remove config/video-layout.xml and load the default, mainly oriented to users not comfortable with config files who just want to use the newest layout.

What is the "common" way to do it in GC? I can think of at least 3 plausible options:

  • simply erase video-layout.xml and replace with builtin defaults
  • remove video-layout.xml.bak if it exists, move video-layout.xml to video-layout.xml.bak and replace video-layout.xml with the builtin defaults. GC does something similar in src/Gui/SaveDialogs.cpp and src/Gui/SplitActivityWizard.cpp.
  • mv video-layout.xml to video-layout.xml.date.bak where "date" is the current date with enough resolution to insure unicity. You do not loose anything but versions can accumulate.

@amtriathlon
Copy link
Member

I will udate the TextMeterWidgetEnhancements. The ControllerSetWeight patch is not impacted.

The other affected was LiveMap, but it is already fixed and merged in its basic functionality for position tracking.

A nice addition would be a "Reset to Default" button to remove config/video-layout.xml and load the default, mainly oriented to users not comfortable with config files who just want to use the newest layout.

What is the "common" way to do it in GC? I can think of at least 3 plausible options:

  • simply erase video-layout.xml and replace with builtin defaults
  • remove video-layout.xml.bak if it exists, move video-layout.xml to video-layout.xml.bak and replace video-layout.xml with the builtin defaults. GC does something similar in src/Gui/SaveDialogs.cpp and src/Gui/SplitActivityWizard.cpp.
  • mv video-layout.xml to video-layout.xml.date.bak where "date" is the current date with enough resolution to insure unicity. You do not loose anything but versions can accumulate.

For Reset Layout(s) we are using 1), see:

HomeWindow::restoreState(bool useDefault)

with the ability to get (supposedly) more updated versions from goldencheetah.org
For activities 2), but I think it is overkill in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants