Fix the Edit menu disappearing when changing languages.#4797
Fix the Edit menu disappearing when changing languages.#4797amtriathlon merged 1 commit intoGoldenCheetah:masterfrom
Conversation
There was a problem hiding this comment.
Is this relevant to the editMenu fix ?
There was a problem hiding this comment.
Nope! That's QT noise on Macs that I was going to remove but forgot to.
|
Good catch, the fact it only happens on macOS when using translations disoriented me. |
|
Ok, I think I've fixed it (it worked just fine while testing). For translations to kick in you need to restart GC but that's a problem outside of this patch. |
|
@gille: Just out of curiosity, do you know why aboutToShow didn't work here? |
The edit menu attempted to populate itself with aboutToShow() but this is fragile on Mac when the system menu is empty. Also fixed a (very minor) memory leak and rewrote some code in more modern C++. Fixes: GoldenCheetah#4647
|
The problem is that aboutToShow() doesn't fire the way you hope it does (the way it's supposed to!). MacOS (Cocoa?) is very opinionated about the Edit menu and if it is empty MacOS might just decide to not show it at all. For a while it seemed related to the ->clear() but then I noticed the signal didn't even trigger the way we hoped it did. Forcing a population of the contents avoids this and returns your original idea which lets us use signals the way they're intended. I was even able to reproduce this (with some struggle) with English language (no translation) but only on a native ARM64 binary. |
|
Retrospectively Joachim's change likely worked since it involved renaming the top level menu from Edit to Process, it was me who introduced this issue renaming it back in 5ef6080, considering the way we use that menu is unrelated to typical Edit system menus perhaps to rename it was a good idea after all, to change the wiki is not that a big issue and abandoned translations seems to be a lost cause. |
|
@amtriathlon I can reproduce the bug regardless of menu name and translation (it's just less deterministic with English). The core problem is the empty menu. Currently all this does is a force menu build which is near free and will be safe regardless of what we call the menu. |
|
Ok, so the real fix is to add this before connecting the and all the remaining changes are non-functional refactoring, am I right? |
|
Yes that's the actual bug fix. This also fixes a small memory leak, without this the QActions pile up until you exit GC. |
|
Thank you. |
Main changes from v3.8-DEV2601: 686f431 Revert to Qt 6.5.3 for macOS builds a00e276 Dialog to build filter queries for similar activities (#4805) 749a21d Train mode: Improved readability for ErgFilePlot (#4806) 3e8c6fe Updating power values of planned activities with linked workouts (#4799) 1c69798 Fix Edit menu disappearing when changing languages on macOS (#4797) [publish binaries]
Changes from v3.8-DEV2601 4db88fa Update translation files 663526c Choose cyclist default to no avatar (#4814) f6d4f6a Using "actual activity" instead of "completed activity" (#4813) 253b220 Add Zoomed Elevation Widget to Graphical Meters For simulation workouts without GPS data b0d16d1 Add reconnect attempt timer after BT40Device unexpected disconnect (#4812) c85da47 Fix typo in Nonzero Average Power description 07e673d Selectable show/hide planned activities (#4811) 1a4dd1d Updated Time Range context menu (#4808) 686f431 Revert to Qt 6.5.3 for macOS builds a00e276 Dialog to build filter queries for similar activities (#4805) 749a21d Train mode: Improved readability for ErgFilePlot (#4806) 3e8c6fe Updating power values of planned activities with linked workouts (#4799) 1c69798 Fix Edit menu disappearing when changing languages on macOS (#4797) [publish binaries]
Changes from v3.8-DEV2601 3b5ec90 Fix bug in RideMetadata 9087c0d Combine view indexes and view relevance definitions into single enumerated type (#4795) a0fe8af Planned activities: Keeping track of original date (#4822) 31d8708 Fix default Plan layout a124799 AppVeyor - Refactor Windows build scripts (#4820) d8b10fe Cloud Service creates unnecessary GlobalContext instances (#4823) 40db2bc Standardize how the config is created for releases. (#4784) 6ab9950 AppVeyor - run lupdate on Windows a36f527 Copy & Paste for planned activities on calendar (#4819) dfd932d Fit file import - don't crash on malformed files 2eaf1bc Upgrade Python, Pandas, and SIP versions (#4747) b00d3b7 Update German translation 4db88fa Update translation files 663526c Choose cyclist default to no avatar (#4814) f6d4f6a Using "actual activity" instead of "completed activity" (#4813) 253b220 Add Zoomed Elevation Widget to Graphical Meters For simulation workouts without GPS data b0d16d1 Add reconnect attempt timer after BT40Device unexpected disconnect (#4812) c85da47 Fix typo in Nonzero Average Power description 07e673d Selectable show/hide planned activities (#4811) 1a4dd1d Updated Time Range context menu (#4808) a00e276 Dialog to build filter queries for similar activities (#4805) 749a21d Train mode: Improved readability for ErgFilePlot (#4806) 3e8c6fe Updating power values of planned activities with linked workouts (#4799) 1c69798 Fix Edit menu disappearing when changing languages on macOS (#4797) [publish binaries]
The edit menu attempted to populate itself with aboutToShow() but this is fragile in this case.
Fixes: #4647