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

Fix crash on exit on MacOS if using Cura's translations #10169

Merged
merged 3 commits into from Jul 23, 2021

Conversation

Ghostkeeper
Copy link
Collaborator

@Ghostkeeper Ghostkeeper commented Jul 22, 2021

If you're using Cura in a different language, it was crashing on MacOS due to being moved to the special "Ultimaker Cura" menu that MacOS creates. These were the reproduction steps:

  • Change Cura's language in its preferences menu.
  • Restart Cura to complete the language change.
  • Exit Cura. MacOS gives an error message then.

To fix this, certain menu entries should not be translated. Translating them causes Cura to update the menu entry's name upon closing down Cura, but the menu entry can't be found in its original place any more. The Qt documentation warns us that signals on the moved Menu elements won't work well any more.

The items changed below are the items that are moved by MacOS. Only those should not be translated any more. The rest should still be translated. MacOS itself should translate the moved menu items into the user's system language (which is out of Cura's control and may be different from the language preference in Cura).

Fixes CURA-8245 and fixes #9837.

There's a suspicion that this is causing a crash on exit. From the traceback it seems like it's attempting to find a certain property on a deleted item. I'm thinking it might be trying to update properties on an item that was already deleted by the system here because the item got moved to a system-specific menu. Qt doesn't realise that. By not translating that property, it's not necessary to update and hopefully this prevents the need to look up data on the deleted item.
Not translating it is not an issue anyway, since the menu will also be renamed by Qt to some system-specific name, which is then also translated to the user's system-language by MacOS itself.

It's not at all sure if this will fix it. Tests are necessary.

Contributes to issue CURA-8245.
Perhaps this ampersand was messing with it.

Contributes to issue CURA-8245.
@Vandresc Vandresc merged commit 5f39de0 into master Jul 23, 2021
@Ghostkeeper Ghostkeeper deleted the CURA-8245_macos_crash_exit_translated branch July 29, 2021 09:26
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.

Cura crashes on exit if language is not English
3 participants