Page 1 of 1

Allow undeletable comments in bar-files

Posted: 2018-05-22, 09:44 UTC
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

Posted: 2018-05-22, 11:06 UTC
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)...

Posted: 2018-05-22, 11:32 UTC
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.

Re: Allow undeletable comments in bar-files

Posted: 2018-05-22, 12:12 UTC
by Vochomurka
Vochomurka wrote:...Execute the cm_ButtonConfig command, that is, open this button bar in TC (not a single button)...

Posted: 2018-05-22, 14:20 UTC
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.

Posted: 2018-05-22, 15:14 UTC
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%

Posted: 2018-05-22, 16:23 UTC
by MVV
Vochomurka,
If TC writes BAR files per section, you can create your own section and it must be preserved between file modifications...

Posted: 2018-05-22, 16:28 UTC
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