Allow undeletable comments in bar-files

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Allow undeletable comments in bar-files

Post by *Vochomurka »

1. Open any *.bar file in text editor and type any line starting with semicolon (;). It is a standard comment character in configuration (ini) files that bar-files actually are;
2. Execute the cm_ButtonConfig command, that is, open this button bar in TC (not a single button). Make some changes or just press OK;
3. The comment line disappears from the bar-file.

Please change such behaviour. Sometimes user has to write comments to keep some info, or just to exclude temporarily some line(s).
It would be much better to introduce new key "comment" like this:

Code: Select all

cmd12=c:\some\path\program.exe
param12=/any /params
button12=c:\some\path\program.exe,1
path12=c:\some\path\
iconic12=1
comment12=My favourite program, blah-blah-blah...
When a button is copied to/pasted from the clipboard, the comment is copied/pasted too.
There is no need to add a corresponding edit field into the "Change button bar" dialog. The "comment" key can be available in manual file editing only
Single user license #329241
PowerPro scripts for Total Commander
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Confirmed, it seems that TC just writes BAR files from loaded buttonbar object, so all unsupported parameters and comments get lost.

I think it will not be easy to save BAR files w/o overwriting it, because it will require to enumerate all unused keys in order to delete them (e.g. when user deletes a button, TC will need to delete extra parameters explicitly)...
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Note that there is a difference in how TC is writing bar files depending on whether you open the whole bar for editing or just a single button. When you only open a single button, the changes are written in the end of the bar file or at random places, if you edit the button from the bar file editor. all the buttons are (re)written according to their number - I often use that just to make the bar file more tidy.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Re: Allow undeletable comments in bar-files

Post by *Vochomurka »

Vochomurka wrote:...Execute the cm_ButtonConfig command, that is, open this button bar in TC (not a single button)...
Single user license #329241
PowerPro scripts for Total Commander
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC uses WritePrivateProfileSection for faster write access - this means a single write call for the entire ini section instead of dozens of calls. This is done because some virus scanners scan the file on each write call. Unfortunately comments are lost this way.
Author of Total Commander
https://www.ghisler.com
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

2ghisler(Author)
What about the new bar-file key "comment"? They definitely will not be numerous and wordy. Even if so, the write/read speed would increase some 10-15%
Single user license #329241
PowerPro scripts for Total Commander
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Vochomurka,
If TC writes BAR files per section, you can create your own section and it must be preserved between file modifications...
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Yes, I can. But I would like that ;-comments keep their position next to the key that needs commenting, and that key-comments be copied/pasted together with other keys for a specific button
Single user license #329241
PowerPro scripts for Total Commander
Post Reply