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

About dialog: Enhance changelog parsing, add support for new format #3653

Merged
merged 3 commits into from
Oct 16, 2020

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Aug 7, 2020

I finally came up with the perfect solution to OpenShot/libopenshot#486 and OpenShot/libopenshot-audio#92 (my proposed new Git changelog formats), which have been in WIP status pending compatibility with the About dialog's changelog listing.

This PR updates about.py to:

  • Rework the existing parsing into reusable function parse_changelog(), called once per project
  • Add a second, alternative parse_new_changelog() to read the new-format files
  • Check for both file types, the old-style files in settings/project.log, the new files in resources/project.log.

If it finds a new-style file, it'll read it. If it can't, or it's not found, it'll try for an old-style file. If neither can be found/read, it'll remove that individual tab from the dialog, so that there aren't any empty listings. (If none of the 6 files is present, the Changelog button is removed from the About dialog completely, same as always.)

That means that this can (and should) be merged before any format changes. It'll keep on supporting the old format, and then at whatever point we choose we can switch over to generating new format files and placing them in resources/ instead.

- Rework parsing into reusable function
- Add second parser for alternate changelog format
- Simplify initial detection, only check if file exists
- Hide tabs for any missing/unreadable changelogs
@ferdnyc ferdnyc added the interface GUI / user interface issues (i.e. windows, buttons, scrolling, pop-ups, etc...) label Aug 7, 2020
src/windows/about.py Outdated Show resolved Hide resolved
@jonoomph
Copy link
Member

@ferdnyc What about the for encoding_name in ('utf_8', 'utf_16'): support for Windows changelog files. Is this no longer needed? I found it necessary due to Windows' git changelog was (for some reason) in the wrong format.

@jonoomph
Copy link
Member

I resolved the conflicts on this one, so we can merge it. If we need to handle the different UTF formats for Windows, we can always make a new PR. I'll test this one shortly.

@jonoomph jonoomph merged commit eba530b into OpenShot:develop Oct 16, 2020
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Oct 24, 2020

@jonoomph Sorry, missed that question until now.

The different encoding attempts are still there. I moved that code into a reusable function parse_changelog (at the start of about.py), so it can be called for each of the files. But the code there is pretty much the same as before, just DRYer.

@ferdnyc ferdnyc deleted the new-changelog-parsing branch April 27, 2021 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interface GUI / user interface issues (i.e. windows, buttons, scrolling, pop-ups, etc...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants