[implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blank

Here you can propose new features, make suggestions etc.

Moderators: petermad, Stefan2, white, Hacker

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 15819
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

[implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blank

Post by *petermad »

It could be desirable, that if the"Tooltip" field for a button is blank, then the text at the menu= line in the [em_command] definition in WCMD_LNG.INI (secondary in usercmd.ini) would be used.

See: viewtopic.php?p=464666#p464666 for more discussion
License #524 (1994)
Danish Total Commander Translator
TC 11.50rc3 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1385a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
nsp
Power Member
Power Member
Posts: 1891
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blank

Post by *nsp »

in a bar file, when you add a command from usercmd.ini wcmd_lng.ini, the tooltip is replicated in the menuXXX.
In order to have same tooltip as original file in sync :
- the tooltip should not be replicated automatically
- if empty it should be read from origin file

-Most of the already created button should have original tooltip never updated unless tooltip is removed.
User avatar
petermad
Power Member
Power Member
Posts: 15819
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blank

Post by *petermad »

2nsp
- if empty it should be read from origin file
Exactly my point - for cm_commands it should be read from wcmd_lng.ini - so that it is English if I use wcmd_eng.ini and in German if I use wcmd_deu.ini - provided that both .ini files have the em_command and they both have a tooltip defined for that command (that they have a: menu= line i the .ini file)
License #524 (1994)
Danish Total Commander Translator
TC 11.50rc3 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1385a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
nsp
Power Member
Power Member
Posts: 1891
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blank

Post by *nsp »

petermad wrote: 2024-12-03, 01:11 UTC for cm_commands it should be read from wcmd_lng.ini
@Petermad
The main difference i how bar file are built, when using a :
  • cm_ commmand from command browser, the tooltip is not carried unless you edit it manually.
  • With em_ command the tooltip is replicated and so the source is the bar file itself.
Here if creation/maintenance of bar file is not changed, if you decide tomorrow to modify the menu entry for em_xxx in your wincmd_LNG.ini file the tooltip will not be updated if the usercmd.ini em_command have menu entry.

So side to the suggested mechanism, a bar updater tool should remove the tooltip of em_cmd if equal or the one defined in usercmd.ini or wcmd_lng.ini
User avatar
petermad
Power Member
Power Member
Posts: 15819
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blank

Post by *petermad »

history.txt wrote:03.12.24 Added: Button bar, em_command: Read tooltip from em_command definition if none is set for the button itself (32/64)
Thank you fro implementing this :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.50rc3 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1385a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
nsp
Power Member
Power Member
Posts: 1891
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *nsp »

Current implementation only takes the menu entry in usercmd.ini if em_cmd is defined in usercmd.ini it is not possible to have translation in wcmd_eng.ini to override it when switching languages.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49978
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *ghisler(Author) »

You cannot define an em_command in usercmd.ini if it's already defined in the current language ini, and vice versa. If you put it in the ini manually, the entry in usercmd.ini takes precedence over the one in the language ini.
Author of Total Commander
https://www.ghisler.com
User avatar
nsp
Power Member
Power Member
Posts: 1891
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *nsp »

ghisler(Author) wrote: 2024-12-05, 07:44 UTC You cannot define an em_command in usercmd.ini if it's already defined in the current language ini, and vice versa. If you put it in the ini manually, the entry in usercmd.ini takes precedence over the one in the language ini.
I was just referring of definition in usercmd.ini and a translation for the menu entry only in wcmd_lng.ini to have common definition and then translations of tooltips.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49978
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *ghisler(Author) »

That's an interesting idea, but it could also cause problems. Example: Command em_notepad.
usercmd.ini points to notepad.exe and description "Windows Notepad".
wcmd_fra.ini points to notepad++.exe and description "Éditeur Notepad ++".

With your suggestion, the tooltip would show "Éditeur Notepad ++" but the button would launch notepad.exe.

There are two possible solutions:
1. Always prefer the internal command from the translation - this would break compatibility
or
2. Use the translation from wcmd_fra.ini only if either
- the command is empty, or
- usercmd.ini doesn't contain the command.
Author of Total Commander
https://www.ghisler.com
User avatar
nsp
Power Member
Power Member
Posts: 1891
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *nsp »

ghisler(Author) wrote: 2024-12-06, 09:30 UTC 2. Use the translation from wcmd_fra.ini only if either
- the command is empty, or
- usercmd.ini doesn't contain the command.
Yes this is exactly what I understand as override translation only if empty menu is dedined on the bar file.
Currently if an em_cmdXXX is defined in wcmd_fra.ini this one take precedence over usercmd.ini, by option 2 this will always be the case.
in your case it will launch notepad++ with tooltip in french.
if em_cmdXXX have only menu entry and no command definition in wcmd_fra.ini then it will launch notepad and will have a tooltip in French.

Option 1 will break default behavior of having lng file taking precedence.
User avatar
petermad
Power Member
Power Member
Posts: 15819
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *petermad »

2. Use the translation from wcmd_fra.ini only if either
- the command is empty, or
- usercmd.ini doesn't contain the command.
Good idea. What about a third possibility:
- if the command is the same in usercmd.ini and wcmd_fra.ini - then use menu= from wcmd_fra.ini
License #524 (1994)
Danish Total Commander Translator
TC 11.50rc3 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1385a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49978
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *ghisler(Author) »

That's a good idea, I will handle that too.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 15819
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *petermad »

history wrote:08.12.24 Fixed: Button bar, em_command: Prefer tooltip from wcmd_<language>.ini and not usercmd.ini if the same em_command exists in both, and the command is the same or empty in one of the files (32/64)
Works perfectly in TC 11.50rc2 :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.50rc3 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1385a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49978
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [implemented] Make Buttons use the tooltip from the [em_command] definition, when the button's tooltip field is blan

Post by *ghisler(Author) »

Thanks for suggesting it!
Author of Total Commander
https://www.ghisler.com
Post Reply