[TC 11.03] cm_ReloadBarIcons not reloading main menu icons

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

[TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *jonathanpoulin »

The description of cm_ReloadBarIcons is:

Code: Select all

Force reload icons in button bars and main menu
It works for existing main menu items. But, it does NOT for new ones for em_commands, with assigned icon in library's .inc file (for example, wcmicons.inc). In that case, TC must be restarted.
Last edited by jonathanpoulin on 2024-07-14, 11:59 UTC, edited 3 times in total.
Thanks,
Jonathan Poulin
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7008
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: cm_ReloadBarIcons not reloading main menu icons

Post by *Horst.Epp »

Why is this a bug report ?
There is no place in the help or any other place which says this should work.
So make a suggestion
and use as work-around
cm_exit 9
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC6 x64 / x86
Everything 1.5.0.1395a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.3 x64
User avatar
petermad
Power Member
Power Member
Posts: 16098
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_ReloadBarIcons not reloading main menu icons

Post by *petermad »

2Horst.Epp
totalcmd.inc wrote:cm_ReloadBarIcons=2945;Force reload icons in button bars and main menu
I think this indicates that it should work also for icons in the main menu.

I find it is reasonable to expect that if I reload a changed .mnu file and then use cm_ReloadBarIcons, the change should be reflected, as it is if I reload TC.

This concerns menu files with icons for em_commands assigned in the icon library's .inc file (for example wcmicons.inc), after adding a new em_command to the menu file.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: cm_ReloadBarIcons not reloading main menu icons

Post by *jonathanpoulin »

2Horst.Epp
Horst.Epp wrote: 2024-07-13, 17:52 UTC Why is this a bug report ?
Because, for me this is a (minor) bug.
Horst.Epp wrote: 2024-07-13, 17:52 UTC There is no place in the help or any other place which says this should work.
As I said, the description is: "Force reload icons in button bars and main menu". IMHO, this is misleading/erroneous a little bit. But, again, this is minor... I am developer myself, so when I see things not okay, I report it.
Horst.Epp wrote: 2024-07-13, 17:52 UTC use as work-around
cm_exit 9
Yes, this is what I use often to be sure to apply my changes.

:)
Thanks,
Jonathan Poulin
User avatar
jonathanpoulin
Member
Member
Posts: 131
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: cm_ReloadBarIcons not reloading main menu icons

Post by *jonathanpoulin »

2petermad
petermad wrote: 2024-07-13, 18:31 UTC I find it is reasonable to expect that if I reload a changed .mnu file and then use cm_ReloadBarIcons, the change should be reflected, as it is if I reload TC.
Thanks, this is my minding.
petermad wrote: 2024-07-13, 18:31 UTC This concerns menu files with icons for em_commands assigned in the icon library's .inc file (for example wcmicons.inc), after adding a new em_command to the menu file.
Yes, exactly. This is the use case. The only one that isn't working. Thank you very much to precise it. My original post was not complete. I will edit it.
Thanks,
Jonathan Poulin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *ghisler(Author) »

Sorry, I don't understand the problem. Do you mean that TC should re-read the library's inc file to check for changed icon assignments in it?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16098
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *petermad »

2ghisler(Author)
TC should re-read both the library's inc file to check for changed icon assignments in it, AND re-read the .mnu file for changed/added/deleted menu items - to resync the .mnu and the icon .inc files.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
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: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *ghisler(Author) »

Could you try a button with
OPENLANGUAGEFILE wcmd_dan.lng
or
OPENLANGUAGEFILE
for English? It should reload the menu file. cm_ReloadBarIcons does not reload the menu.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16098
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *petermad »

2ghisler(Author)
Could you try a button with
OPENLANGUAGEFILE wcmd_dan.lng
That is already how I roload the menu file after I have made changes to it - it does not re-sync the .mnu file with wcmicons.inc file.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
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: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *ghisler(Author) »

it does not re-sync the .mnu file with wcmicons.inc file.
What do you mean with this? I tried the following:
1. Create a start menu entry with a command other than cm_ or em_ in at the top, e.g. OPENBAR VERTICAL.BAR or notepad.exe
2. Saved the menu - it has no icon
3. Opened the file WCMICONS.INC for editing and appended
701=81
4. Saved the file
5. Started the command
OPENLANGUAGEFILE wcmd_dan.lng
from a button or the command line.
-> The first menu item now has an icon looking like gray sheet of paper
6. Removed 701=81 from WCMICONS.INC
7. Started the command
OPENLANGUAGEFILE wcmd_dan.lng
from a button or the command line.
-> The first menu item no longer has an icon.

I also created a menu entry with command cm_SrcShort, which would be command nr. 301.
Then I changed the line
301=3
to
301=4
and ran OPENLANGUAGEFILE wcmd_dan.lng
-> The icon changed from that for brief view to that of full view, both in the start menu and the main View menu (Vis in Danish).
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16098
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *petermad »

2ghisler(Author)
Create a start menu entry with a command
We are not talking about the Start menu, but the Main menu - as I wrote "it does not re-sync the .mnu file" and as the subject of this topic says.

Try this:
  1. Enable "Show icons for commands in the main menu" in the configuration.
  2. Make an em_command for notepad.exe
  3. Add this item to the wmcd_dan.mnu file, just below POPUP "&Fil".:

    Code: Select all

    MENUITEM "Notepad", em_notepad
  4. Add this to the wcmicons.inc file:

    Code: Select all

    10000=28
  5. Perform OPENLANGUAGEFILE wcmd_dan.mnu to load/reload wcmd_dan.mnu
  6. Perform cm_ReloadBarIcons
  7. Open the "Fil" entry in the menu - there is no icon left of "Notepad"
  8. Perform cm_Exit 9.
  9. Open the "Fil" entry in the menu - now there is an icon left of "Notepad".
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
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: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *ghisler(Author) »

I cannot reproduce that. After OPENLANGUAGEFILE the icon is there.
However, you can't rely on the command values 10000 and above: TC assigns them to internal em_commands in the order they are loaded. When there were other em_commands elsewhere before editing the mnu file, TC may have already assigned command values to them (and they are cached until you close TC). I will NOT change this caching mechanism, sorry.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16098
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.03] cm_ReloadBarIcons not reloading main menu icons

Post by *petermad »

TC assigns them to internal em_commands in the order they are loaded. When there were other em_commands elsewhere before editing the mnu file
I know that.
they are cached until you close TC
Aha, that explains it.


Moderator message from: petermad » 2024-07-21, 17:07 UTC

Moved to "TC Behaviour which will not be changed" from "TC11.x bug reports (English)"
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply