Skip to content

Close add build info to About window, #3977 #4066

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

Merged
merged 3 commits into from
Mar 24, 2023
Merged

Close add build info to About window, #3977 #4066

merged 3 commits into from
Mar 24, 2023

Conversation

low-batt
Copy link
Contributor

This commit will:

  • Add a new class InfoDictionary that exposes some Info.plist entries as properties

  • Change AppDelegate, GuideWindowController, InitialWindowController, and JavascriptAPICore to use InfoDictionary instead of methods in the Utility class

  • Remove iinaCopyright and iinaVersion methods from Utility class

  • Add FFmpeg version to About window

  • Add build date and build branch as hidden entries in About window that are exposed via an option-click

  • I have read CONTRIBUTING.md

  • This implements/fixes issue Add hidden info about the build to the About window #3977.


Description:

This commit will:
- Add a new class InfoDictionary that exposes some Info.plist entries as
  properties
- Change AppDelegate, GuideWindowController, InitialWindowController,
  and JavascriptAPICore to use InfoDictionary instead of methods in
  the Utility class
- Remove iinaCopyright and iinaVersion methods from Utility class
- Add FFmpeg version to About window
- Add build date and build branch as hidden entries in About window that
  are exposed via an option-click
@low-batt
Copy link
Contributor Author

The About window now shows the FFmpeg version:
issue-3977-before-click

An option-click between the versions and the License button reveals information about the build:
issue-3977-after-click

@low-batt low-batt linked an issue Nov 11, 2022 that may be closed by this pull request
@low-batt low-batt requested a review from uiryuu November 11, 2022 17:46
///
/// This class exposes some of the entries contained in `Bundle.main.infoDictionary` as properties to provide for easier access
/// to information contained in the dictionary from other classes.
class InfoDictionary {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class InfoDictionary {
struct InfoDictionary {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darn. Forgot about structs yet again. Fixed.

Comment on lines 25 to 30
var copyright: String { Bundle.main.infoDictionary!["NSHumanReadableCopyright"] as! String }

var version: (String, String) {
let infoDic = Bundle.main.infoDictionary!
return (infoDic["CFBundleShortVersionString"] as! String, infoDic["CFBundleVersion"] as! String)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these two computed and the others aren't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally were stored properties. Then I began thinking reviewers might question why we are storing these values that are rarely referenced. So I converted these to match up with the Utility methods they replaced. I've pushed a commit that changes them all to be computed. If you would prefer they are all initialized once in an init method just let me know and I'll change it to be all stored properties.

Addressed review comments.

This commit will:
- Add a new class InfoDictionary that exposes some Info.plist entries as
  properties
- Change AppDelegate, GuideWindowController, InitialWindowController,
  and JavascriptAPICore to use InfoDictionary instead of methods in
  the Utility class
- Remove iinaCopyright and iinaVersion methods from Utility class
- Add FFmpeg version to About window
- Add build date and build branch as hidden entries in About window that
  are exposed via an option-click
/// which the build was made. As this information is only interesting to developers that take builds to other machines for long term
/// testing this information is hidden and only reveled if the user option-clicks between the mpv and FFmpeg versions and the
/// `License` button.
override func mouseUp(with event: NSEvent) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is appropriate to hide this information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The build date and branch are no longer hidden. The code is "friendly" and will just not log or display the build information if it is missing from Info.plist.

I copied macOS's convention of hiding information in About This Mac as I thought I would hear lots of objections to including this information during review such as:

  • Normal users do not know what a source control branch is
  • The additional information makes the window look cluttered
  • Both the build date and branch are well known for the release version
  • The build date and branch are not labeled
  • Reminding users of the release date may increase the calls for a new release
  • The branch for the release duplicates the version number that is already listed
  • Other applications do not display such information in their About windows

Of those the one that bothers me is the inclusion of the branch name. That is an implementation detail that most users will not understand.

If you have any second thoughts about showing the branch name do not hesitate to ask for more changes. I'm happy to tweak this some more if needed. If there is additional information you think should be included I can look into that as well, or we could plan to add that in the future as I do need to get back to fixing bugs.

Most applications do not display this kind of information, but I dug around some more and found a few examples of applications that include information for developers.

LibreOffice has a link to the git commit along with other information of interest to developers on its About window:

issue-3977-LibreOffice

Wireshark lists a lot of information for developers on its About window:
issue-3977-Wireshark

KeePassXC has a Debug Info tab on its About window. I was unable to take a screen shot of that window. I used the Copy to clipboard button to capture what it shows:

KeePassXC - Version 2.7.1
Revision: 5916a8f

Qt 5.15.2
Debugging mode is disabled.

Operating system: macOS 13.0
CPU architecture: arm64
Kernel: darwin 22.1.0

Enabled extensions:
- Auto-Type
- Browser Integration
- SSH Agent
- KeeShare
- YubiKey
- Quick Unlock

Cryptographic libraries:
- Botan 2.19.1

I definitely prefer the cleaner more stylish look of IINA's About window over these windows.

I do plan on eventually enhancing startup to log more information about the Mac IINA is running on.

This commit will:

- Add a new class InfoDictionary that exposes some Info.plist
  entries as properties
- Change AppDelegate, GuideWindowController, InitialWindowController,
  and JavascriptAPICore to use InfoDictionary instead of methods in
  the Utility class
- Remove iinaCopyright and iinaVersion methods from Utility class
- Add FFmpeg version to About window
- Add build date and build branch to About window

Updated to not require an option-click to expose the build info as per
review comments.
@uiryuu uiryuu merged commit 98af145 into develop Mar 24, 2023
@uiryuu uiryuu deleted the close-3977 branch August 17, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add hidden info about the build to the About window
3 participants