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

Uses lower-case extensions for Aah preview image #3909

Merged
merged 4 commits into from
Apr 12, 2023

Conversation

emmebi
Copy link
Collaborator

@emmebi emmebi commented Apr 10, 2023

Identify the Bug or Feature request

Fixes #3892

Description of the Change

The preview files for Aah theme had a PNG filename extension, but were referred as png in the code; this change renames the filename name extensions to png for consistency with all the other images already in the package.

The change also adds some logs around the retrieval of the image, and the usage of an empty ImageIcon in case the preview can't be loaded.

Possible Drawbacks

The performance loss caused by the logs should be negligible, as this happens only when retrieving the theme.

The usage of an empty ImageIcon prevents a traceback to reach the customer, but could hide the problem (i.e. the fact that the names of the preview files are wrong). This risk is mitigated however by the fact that the condition is correctly logged in the files.

Documentation Notes

Note that the problem doesn't manifest itself when developing on Windows, because the resource is accessed via a file system path, which are case-insensitive under Windows.

Release Notes

  • Fixes an issue where theme selection dialog could show a traceback

This change is Reviewable

new ImageIcon(
ThemeSupport.class.getResource(IMAGE_PATH + themeDetails.imagePath),
themeDetails.name);
new ImageIcon(ThemeSupport.class.getResource(imageLocation), themeDetails.name);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use imageURL here as well for a bit more clarity.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I actually wanted to do that!

@cwisniew cwisniew merged commit abcaefd into RPTools:develop Apr 12, 2023
@cwisniew cwisniew added the bug label Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error on theme select
3 participants