Uniquely named custom column configs (more custom column configs)

From TotalcmdWiki
Jump to: navigation, search

My request is to load columns by names instead of numbers. Of course this has to be change in a back and forward compatible way. I have found a way to achieve this now. Here is the description:

Scenario 1: A user just changed from older TC versions and wants to edit column config #1:

Before the change the settings looked liked that:

Titles=Search result|..other titles..
Widths1=69,86,300,128
Headers1=Pfad\nAenderungsdatum
Options1=-1|1
Content1=[=tc.path]\n[=tc.writedate]

Now he makes the following changes:

Titles=Search result|...other titles...
Widths1=69,86,300,128,20
Headers1=Pfad\nAenderungsdatum\nGröße
Options1=-1|1
Content1=[=tc.path]\n[=tc.writedate]\n[tc.Size]

Now TC saves the changes but also creates the following new settings:

Widths_Search result=Widths1
Headers_Search result=Header1
Options_Search result=Options1
Content_Search result=Content1

Remarks:

  • This means that there is a corresponding numeric column config. When the user called a column config by its name TC reads this settings first. Then TC detects the reference and get the values from the numeric values. TC always stores these settings like that when there are <= 29 columns defined.
  • The user could now access the configs with there friendly name. That means there are commands like SOURCELOADCOLUMN columnname (as well as LEFTLOADCOLUMN, RIGHTLOADCOLUMN, TARGETLOADCOLUMN).
  • When resorting or deleting the references must be updated by TC!
  • If a user saves a column config which already has an equally named setting TC displays the warning message (string 1212 in lng file).[/list]

Scenario 2: The user wants to create a new column but there are already 29 defined. If there are already 29 columns configs defined TC creates a "named only" setting. This is no problem older TC versions support only 29 coloumn configs. This would look like this:

Widths_Search result=69,86,300,128,20
Headers_Search result=Pfad\nAenderungsdatum\nGröße
Options_Search result=-1|1
Content_Search result=[=tc.path]\n[=tc.writedate]\n[tc.Size]
  • The "Titles" setting doesn't have to be updated. The title is uniquely stored behind each named column config setting
  • These new settings are not read by older TC versions and cause no trouble at all. When using and older TC version the user can still access the configs between 1 and 29.


The [Left] and [Right] as well as tab section store the current view as a number. A new entry "View" should be added which stores view to be loaded as the unique view name as described above. This doesn't break compatibility but allows additional custom column views.


Conclusion:This suggestion doesn't change anything for a older TC versions user even if he uses a new ini file. Instead new settings are created which extend the functionality. The advantages are that TC handles the resorting/delete problematic even for old column configs and let the user call a column config way easier.

Forum discussions:


Back to Custom column view