How to use "Auto Switch Mode" ?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
slishnevsky
Junior Member
Junior Member
Posts: 8
Joined: 2023-12-11, 02:43 UTC

How to use "Auto Switch Mode" ?

Post by *slishnevsky »

Hello.

I want TC to behave like this:

When I switch to "Pictures" folder, I want it to switch to Thumbnail mode.
When I switch to any other folder, I want it to switch to Full mode (the default).
When I am in "Pictures" folder (in Thumbnail mode), if I press Backspace, it will take me out of "Pictures" folder, and I want it to switch to Full mode.

How can I do that?
Can't make the Backspace function to work. It leaves the "Pictures" folder, but remains in Thumbnail mode.

Thanks.
User avatar
tuska
Power Member
Power Member
Posts: 3790
Joined: 2007-05-21, 12:17 UTC

Re: Auto Switch Mode

Post by *tuska »

Hi,

You can do this as follows - example:

View Mode
- Name: Thumbnails
- Columns view: Thumbnail view
- Sort order: Unchanged (or what you like)

Auto Switch Mode
- ✅ Automatically switch view mode on directory change:
- Rule: +: Must match
- Directory: D:\Pictures\*
- Set this mode: Thumbnails (this is the name of the View Mode!)

- Change to the directory D:\Pictures or subdirectory -> Thumbnail view is displayed
- Change from D:\Pictures to D:\ -> The thumbnail view must be switched off automatically!
  [If this does not happen, then change again to the directory D:\Pictures and then to D:\.
  Carry out the process again if necessary].
________________________________________________________
Overview: View Mode | Auto Switch Mode | Custom columns view
slishnevsky
Junior Member
Junior Member
Posts: 8
Joined: 2023-12-11, 02:43 UTC

Re: Auto Switch Mode

Post by *slishnevsky »

Great! Many thanks!
I believe I have tried this the very first time, because it's the most obvious.
But it didn't work then.
Now I understand why, I needed to restart TC!
User avatar
petermad
Power Member
Power Member
Posts: 14913
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to use "Auto Switch Mode" ?

Post by *petermad »

I needed to restart TC!
That should not be necessary - but maybe you forgot to check the box: "Automatically switch view mode on directory change" the first time you tried.

To be 100% sure that you shift to Full View when leaving the pictures folder you can add:

Code: Select all

*|cm_SrcLong
to the "Auto-run commands" field
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
tuska
Power Member
Power Member
Posts: 3790
Joined: 2007-05-21, 12:17 UTC

Re: How to use "Auto Switch Mode" ?

Post by *tuska »

In my opinion, the following setting is recommended in View mode:
- View mode:    <Default>
- Columns view: Full
- Sort order:      Name

EXITING a View mode with Auto Switch Mode sets this view automatically if no other setting has been made.
BUTTON: Enforce <Default view> for View Mode and Custom View Mode - Example

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_rereadsource 3

wcmicons.dll,86
cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_RereadSource,cm_rereadsource 1,2,3|View mode <Default>: cm_SrcViewMode0|Active panel!|-|cm_RereadSource Ctrl+R|-|cm_rereadsource 1 )|cm_rereadsource 2 )|cm_rereadsource 3 ) --> see: HISTORY.TXT!

0
-1
Create a Button in the Buttonbar (copy/paste CODE)
  1. Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
  2. Right-click on any place in the button bar, then click on "Paste".
     ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
  3. Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
                  A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character.
  4. Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
                  If the "Tooltip" field is empty, the content of the "Command" field is displayed.
  5. Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA)  <-- <Ctrl+click on the link...>
_______________
EDIT: Change
From: cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_RereadSource,cm_rereadsource 1,cm_rereadsource 2,cm_rereadsource 3
To:     cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_rereadsource 3
Thanks to petermad!
Last edited by tuska on 2024-05-23, 18:50 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 14913
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to use "Auto Switch Mode" ?

Post by *petermad »

In my opinion, the following setting is recommended in View mode:
- View mode: <Default>
- Columns view: Full
- Sort order: Name
Where is that recommended? - If you start TC with a clean ini file these two settings are set to Unchanged - so that must be the default.

TOTALCMD#BAR#DATA cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_RereadSource,cm_rereadsource 1,cm_rereadsource 2,cm_rereadsource 3
cm_rereadsource 3 is the same as as executing cm_rereadsource AND cm_rereadsource 1 AND cm_rereadsource 2, so you only need cm_rereadsource 3

EXITING a View mode with Auto Switch Mode sets this view automatically if no other setting has been made.
Unless exiting the View Mode is replaced by another Auto Switch Mode for the new directory you go to, and that new View Mode has "Columns view" set to Unchanged.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
tuska
Power Member
Power Member
Posts: 3790
Joined: 2007-05-21, 12:17 UTC

Re: How to use "Auto Switch Mode" ?

Post by *tuska »

petermad wrote: 2024-05-23, 16:12 UTC
In my opinion, the following setting is recommended in View mode:
- View mode: <Default>
- Columns view: Full
- Sort order: Name
Where is that recommended? - If you start TC with a clean ini file these two settings are set to Unchanged - so that must be the default.
In my opinion, this setting is highly recommended and for good reasons!

There were long discussions at the time as to whether these fields should be filled or not.
In the end, the author agreed with the opinion of a professional user (guess who that was) ;-) to leave these fields with "Unchanged".
Unfortunately, at that time I was not yet familiar enough with the topic to be able to argue against it.

Basically, the View mode "<Default>" is used to create the view that is displayed after EXITING A VIEW MODE with 'Auto Switch Mode'.

Example:
With setting: View mode "<Default>" -> "Unchanged" is e.g. your setting above:
"Auto-run commands" field: *|cm_SrcLong ... ABSOLUTELY NECESSARY, because otherwise, when you leave the directory
the thumbnail view remains available although this is not desired!

With my setting variant (View mode "<Default>"), this code is NOT necessary.

In practice, it would currently look like this for me:

Code: Select all

  66 View modes ... (including <Default> View mode)
- 26 View modes ... (where I have already defined what should be displayed after exiting the View mode)
  -------------
  40 View modes ... I would have to check for View mode "<Default>" -> "Unchanged" whether a code after '|' is required (!) ...
  =============	    Help: "To run commands when a View mode is left, put them behind | (vertical line)."
With the setting: View mode "<Default>" -> "Unchanged", in the vast majority of my cases (40) I would have to think about
which commands I have to enter in the "Auto-run commands:" field behind | (vertical line) to restore my default view.

In any case, every user can decide for themselves which setting variant they prefer.
I am convinced that my setting variant is very effective and will therefore continue to recommend it.
petermad wrote: 2024-05-23, 16:12 UTC
TOTALCMD#BAR#DATA cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_RereadSource,cm_rereadsource 1,cm_rereadsource 2,cm_rereadsource 3
cm_rereadsource 3 is the same as executing cm_rereadsource AND cm_rereadsource 1 AND cm_rereadsource 2, so you only need cm_rereadsource 3
Many thanks for the hint! :)
petermad wrote: 2024-05-23, 16:12 UTC
EXITING a View mode with Auto Switch Mode sets this view automatically if no other setting has been made.
Unless exiting the View Mode is replaced by another Auto Switch Mode for the new directory you go to, and that new View Mode has "Columns view" set to Unchanged.
Yes.
For me, "... if no other setting has been made ..." is a very elastic term. :wink:
User avatar
petermad
Power Member
Power Member
Posts: 14913
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to use "Auto Switch Mode" ?

Post by *petermad »

2tuska
As you also say: every user can use what they prefer.

Personally it is almost never the <default> mode that is active, because I have Auto Switch Mode for the rule L1235 at the end of my rules, which in most cases is mode that TC reverts to when leaving a folder with another rule - the benefit of that is that I can set auto-run commands (for example: *cm_SrcAllFiles) for this pseudo-default mode, which I cannot for the <default> mode. But still even in that mode I use Unchanged for columns and sorting, because I usually don't want a change. If I do want the mode reset, I set it as an auto-run command for leaving the view - for example:
Auto-run commands:

Code: Select all

*cm_SrcByName 8,cm_SrcByDateTime 2|cm_SrcByName 9
which will remember the current sorting (which is not necessarily the <default> sorting) before the view is active, set the sorting to Date/Time, and restore the saved sorting when leaving the view.

But every user - his/hers preference. Just don't rely on other users having Full View and Name Sorting as default, when giving advice, because the defaults when TC is installed are: "Unchanged", and the user might not have changed that.

Actually it is very hard to give advice about the Auto Switch Mode settings, because the sequence of the rules is important (at least when using the D, L, U, V, F, A, P, S rules), so without knowing the content of the users [ViewModeSwitch] and [ListerModes] sections, one's advice might not turn out the way you expected.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
tuska
Power Member
Power Member
Posts: 3790
Joined: 2007-05-21, 12:17 UTC

Re: How to use "Auto Switch Mode" ?

Post by *tuska »

2petermad
Thank you for your detailed explanations.

For me, your settings already require an advanced user (who no longer needs support)
while I consider my settings to be suitable for a beginner - however, it depends on the forum request ...
Post Reply