[Merged] Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

[Merged] Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by Kunda1 »

Discussion thread for issue #4664: Sketcher tooltips have hard-coded hotkey hints

It seems that this would be part of the roadmap for PR 4787 because of the ability for users to also share custom shortcuts with each other. In that case we should factor in logic that removes hardcoded shortcuts from the source and make them conditional on the users configs.
carlopav wrote: pinged by pinger macro
chennes wrote: pinged by pinger macro
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by chennes »

I completely agree -- I'd love to see basically nothing like that hardcoded, even if the preferences are "hidden" and only accessible manually or via preference packs. I think it should be straightforward to modify those tooltips to show the actual currently-set shortcut, rather than the default one. As @yorik mentions in the ticket, it's going to break the translation strings, but it's a one-time cost that's probably worth undertaking.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by Kunda1 »

chennes wrote: Wed Aug 25, 2021 3:13 pm As @yorik mentions in the ticket, it's going to break the translation strings, but it's a one-time cost that's probably worth undertaking.
That is a bummer for sure. That's a ton of work for the translators then. I wish there was a way around that.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by chennes »

Actually, can we re-confirm that this is still happening? I was just looking through the code and it looks like it's pulling the actual shortcut, and in my testing that seems to be working.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by carlopav »

I'm afrai my skills wont be of great help, but also to me the tooltip text defined in the command does not seem to contain the shortcut, it is added to the tooltip when the tooltip is created in the command.cpp...
https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L883
follow my experiments on BIM modelling for architecture design
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by balrobs »

chennes wrote: Wed Aug 25, 2021 3:26 pm Actually, can we re-confirm that this is still happening? I was just looking through the code and it looks like it's pulling the actual shortcut, and in my testing that seems to be working.
I changed shortcuts for commands in Draft, Arch, FEM, Sketcher, Part, Part Design and Techdraw and looked if the tooltip-text and the menu-text reflects the changes. They do but I noticed that doing so changes the newly introduced tooltip-appearance to its old style. To get back to the new style a FreeCAD restart is required! (edit: but then the tooltip shows the default shortcut and not the customised)
I also noticed that while a reset of the shortcuts is immediately shown in the menu-text this isn't true for the tooltip-text. For this to happen a FreeCAD restart is required.

Code: Select all

OS: Ubuntu 20.04.2 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.25556 (Git)
Build type: Unknown
Branch: addThemeSupport
Hash: 98b34779e517a3affdbaa51c7b04f7fd16706a2d
Python version: 3.8.10
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
Last edited by balrobs on Wed Aug 25, 2021 6:48 pm, edited 1 time in total.
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by chennes »

Oh, I see what's happening there. I think I can put together a PR pretty quickly to resolve this.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by chennes »

OK, this should fix it, no retranslation required:
https://github.com/FreeCAD/FreeCAD/pull/4995
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by carlopav »

Did you <include> everything ? :P
Just kidding :) Great work! I should have thought about that with the other PR :oops:
Thanks, i'm continuing to learn!
follow my experiments on BIM modelling for architecture design
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Ticket #4664 - Sketcher (and other WBs) tooltips have hard-coded hotkey hints

Post by chennes »

carlopav wrote: Wed Aug 25, 2021 8:14 pm Did you <include> everything ? :P
:D
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply