mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Don't translate certain keywords in the application menu on MacOS
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.
This commit is contained in:
parent
5bd9970a82
commit
e591f3db5b
2 changed files with 40 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
|
@ -48,7 +48,17 @@ Item
|
|||
|
||||
ViewMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&View") }
|
||||
|
||||
SettingsMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings") }
|
||||
SettingsMenu
|
||||
{
|
||||
//On MacOS, don't translate the "Settings" word.
|
||||
//Qt moves the "settings" entry to a different place, and if it got renamed can't find it again when it
|
||||
//attempts to delete the item upon closing the application, causing a crash.
|
||||
//In the new location, these items are translated automatically according to the system's language.
|
||||
//For more information, see:
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
|
@ -91,7 +101,15 @@ Item
|
|||
Menu
|
||||
{
|
||||
id: preferencesMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "P&references")
|
||||
|
||||
//On MacOS, don't translate the "Preferences" word.
|
||||
//Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it
|
||||
//attempts to delete the item upon closing the application, causing a crash.
|
||||
//In the new location, these items are translated automatically according to the system's language.
|
||||
//For more information, see:
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "P&references" : catalog.i18nc("@title:menu menubar:toplevel", "P&references")
|
||||
|
||||
MenuItem { action: Cura.Actions.preferences }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue