Page 2 of 3

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-23, 14:18 UTC
by ghisler(Author)
Wouldn't it be better with a new 0_usercpec field for that?
Hmm, I didn't want to clutter it any more, but maybe it's better because the | is used also in the filter.

I have created a first implementation and encountered a few more problems:
1. What should happen when the user opens a new tab (Ctrl+T), should the filter be inherited from the current tab?
2. What should the "Show" menu display?
a) the currently active filter for that tab. This may be from a very old tab when switching to it.
b) the last filter the user entered there manually
Currently its b, but there can only be one active filter on one side.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-23, 15:25 UTC
by tuska
Just because it also still fits the topic...
Video (approx. 5 min.)

It is possible to set filters in both windows to tabs and there is a solution but with a restriction:
You can switch between tabs with filters, but *per TC window* you ALWAYS have to switch to a tab without filter in between! *)

If you mistakenly click on two tabs with filters one after the other, the filter is removed from the second tab with filter
and you can/must restore the filter by clicking on the respective button.
*) (Reason: After leaving the 'View mode', the filter must be switched off -> cm_SrcAllFiles).

Requirement:
3 buttons (per button: Filter ON/OFF switch), 3 em_commands and 3 View modes.
The buttons can be applied to any directories and not only to the respective tab.
Buttons

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcViewModeList Pictures

wciconex.dll,25
cm_SrcViewModeList Pictures|em_Pictures||cm_SrcAllFiles,cm_RereadSource 2|cd *.ani *.bmp *.gif *.ico *.jpe *.jpeg *.jpg *.pcx *.png *.psd *.tga *.tif *.tiff *.wmf

0
-1

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcViewModeList Java

wciconex.dll,25
cm_SrcViewModeList Java|em_Java||cm_SrcAllFiles,cm_RereadSource 2|cd *.java

0
-1

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcViewModeList Executable

wciconex.dll,25
cm_SrcViewModeList Executable|em_Executable||cm_SrcAllFiles,cm_RereadSource 2|cd *.bat *.cmd *.exe *.msi *.msp *.msu *.scr

0
-1
em_commands - usercmd.ini

Code: Select all

[em_Pictures]
button=
cmd=cd *.ani *.bmp *.gif *.ico *.jpe *.jpeg *.jpg *.pcx *.png *.psd *.tga *.tif *.tiff *.wmf
menu=cd *.ani *.bmp *.gif *.ico *.jpe *.jpeg *.jpg *.pcx *.png *.psd *.tga *.tif *.tiff *.wmf
[em_Java]
button=
cmd=cd *.java
menu=cd *.java
[em_Executable]
button=
cmd=cd *.bat *.cmd *.exe *.msi *.msp *.msu *.scr
menu=cd *.bat *.cmd *.exe *.msi *.msp *.msu *.scr
View Modes
wincmd.ini - Section [ViewModes]

Code: Select all

55_name=Pictures
55_icon=
55_commands=em_Pictures|cm_50percent,cm_SrcAllFiles,cm_RereadSource 2
55_options=-1|-1|0||-1|-1|-1|16384|16384
56_name=Java
56_icon=
56_commands=em_Java|cm_50percent,cm_SrcAllFiles,cm_RereadSource 2
56_options=-1|-1|0||-1|-1|-1|1908024|1908024
57_name=Executable
57_icon=
57_commands=em_Executable|cm_50percent,cm_SrcAllFiles,cm_RereadSource 2
57_options=-1|-1|0||-1|-1|-1|8388608|8388608

Code: Select all

cm_RereadSource 2
18.12.19 Release Total Commander 9.50 beta 10
13.12.19 Added: cm_rereadsource 2 re-applies automatic view mode change to current directory 
         (cm_rereadsource 3 also forces a refresh if nothing has changed) (32/64)
... CTRL+T is not included in this example. ...
    (The filter would also be present on the new tab)

... The "Show" menu always shows the last filter used in the respective TC window. ...
    (e.g. *.txt ... OR ... *.bat *.cmd *.exe *.msi *.msp *.msu *.scr)

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-23, 16:41 UTC
by petermad
2ghisler(Author)
1. What should happen when the user opens a new tab (Ctrl+T), should the filter be inherited from the current tab?
2. What should the "Show" menu display?
a) the currently active filter for that tab. This may be from a very old tab when switching to it.
b) the last filter the user entered there manually
1. The filter should either be inherited from current tab or be set to *.* - I would prefer the latter.
2. The Show/Left/Right menu should show the currently active filter for that tab, even if it is old (just as for example the sort order is).

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-23, 18:06 UTC
by tuska
2ghisler(Author)
ghisler(Author) wrote: 2021-04-23, 14:18 UTC I have created a first implementation and encountered a few more problems:
1. What should happen when the user opens a new tab (Ctrl+T), should the filter be inherited from the current tab?
2. What should the "Show" menu display?
a) the currently active filter for that tab. This may be from a very old tab when switching to it.
b) the last filter the user entered there manually
Currently its b, but there can only be one active filter on one side.
  1. The filter should be set to *.* (the same happens with Ctrl+Arrow-Right/Left - unless you encounter a filtered view there)
    (If someone wants to get away from this tab with filter, it might be because he also wants to set up a different filter).
  2. a) OR b) .......... EDIT: -> Per Window <-
    a) the currently active filter for that tab ... OR ...
    b) the last filter --> if you switch to a tab that does not have a filter
    For me, this is the current behaviour.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-23, 19:37 UTC
by petermad
b) the last filter --> if you switch to a tab that does not have a filter
I agree on that

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-24, 05:29 UTC
by nsp
ghisler(Author) wrote: 2021-04-23, 14:18 UTC
Wouldn't it be better with a new 0_usercpec field for that?
Hmm, I didn't want to clutter it any more, but maybe it's better because the | is used also in the filter.

I have created a first implementation and encountered a few more problems:
1. What should happen when the user opens a new tab (Ctrl+T), should the filter be inherited from the current tab?
2. What should the "Show" menu display?
a) the currently active filter for that tab. This may be from a very old tab when switching to it.
b) the last filter the user entered there manually
Currently its b, but there can only be one active filter on one side.


1. For New Tab
  • ^T or +^T (in fact duplicate tab) like copy or move to opposite side ! You should keep saved/active filter.(Same logic as today as you copy _path and _options from current tab to new tab)
  • If we open a new tab from command line we should open with *.* as default filter.
  • If you open a new tab from folder using ctrl+shift+L/R arrow *.* should be applied.
  • Last entered filter will have no "global" sense as the context is the tab
2. You should show what is currently applied (active filter) This is the most accurate as it what the user selected lat time the tab was visited. Some works with locked tabs which could be pretty old but still valid when unlocked.
When you switch to a new tab, you do not alter latest view. *.* is considered as a filter and should not be altered. If you want to use old behavior just use a toggle command to enable/disable PerTabFiltering.

-- more topics --
3. for Save tabs you should have the ability to add a separator to add filters and apply them when loading.
  • : is for me a good separator. To take drive letter or unc path in consideration, just skip 2 first char before searching for filter.
4. you can add a new commands or modifiers with CD to apply current filter to opposite tab, apply last filter to current tab.

5. Very optional: You can maintain an history of filters with ability to apply anywhere and with a new menu.

-- edited for clarity --

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-26, 09:37 UTC
by ghisler(Author)
- For now I will not copy the filter when you create a new tab. It would be strange to copy it in some cases but not in others.
- Ctrl+U will not swap filters for now.
- Ctrl+Tab will now show the filter in the tooltip if the tab has one

Please give me feedback once the next beta becomes available later this week.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-26, 12:37 UTC
by nsp
ghisler(Author) wrote: 2021-04-26, 09:37 UTC - For now I will not copy the filter when you create a new tab. It would be strange to copy it in some cases but not in others.
For me the best would be to copy all the time as *.* is a filter like any other.(*.* is default tab filter).
Will you implement a new switch command to have "tab filter"/ "Side filter" globally or an ini Parameter for the start ?

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-26, 12:49 UTC
by tuska
nsp wrote: 2021-04-26, 12:37 UTC
ghisler(Author) wrote: 2021-04-26, 09:37 UTC - For now I will not copy the filter when you create a new tab. It would be strange to copy it in some cases but not in others.
For me the best would be to copy all the time as *.* is a filter like any other. (*.* is default tab filter).
On reconsideration, I would now also be in favour of retaining the filter with CTRL+T.
This would also correspond to the current behaviour.

You could switch off the filter with Ctrl+Left-Arrow/Right keys or a saved key combination.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-27, 14:03 UTC
by ghisler(Author)
During the last few days I have tested these per tab filters, and I found it annoying when the filter was copied to new tabs. Reason: I have set per tab filters for some very special directories, and when I need a new tab, I want to go somewhere ELSE where I don't want that filter. So every time I pressed Ctrl+D I had to first remove the filter. So it's better to add new tabs without the filter.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-27, 17:53 UTC
by nsp
ghisler(Author) wrote: 2021-04-27, 14:03 UTC During the last few days I have tested these per tab filters, and I found it annoying when the filter was copied to new tabs. Reason: I have set per tab filters for some very special directories, and when I need a new tab, I want to go somewhere ELSE where I don't want that filter. So every time I pressed Ctrl+D I had to first remove the filter. So it's better to add new tabs without the filter.
In fact what is annoying is that new tab is duplicate current Tab. What you want is a new tab from hotlist and not duplicate tab and then move to folder. A command to create a new tab from hotlist would be great. Removing filter when you press ^T would be OK, if at least you keep filter when moving/copying to another side.

I have in many hotlist entries like CD <path>,cd *.*
I also have a special hotlist section with many command CD <filter> this does not go anywhere.

i also have a em_newTab like cm_opennewtab , em_no_filter, em_goRoot
no filter is cd *.*
go root is cd \

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-27, 18:13 UTC
by petermad
A command to create a new tab from hotlist would be great
You are aware that Shift+click on an item in the hotlist opens the item in a new tab...?
It even works if you have also set a target dir in the hotlist item.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-28, 04:33 UTC
by nsp
petermad wrote: 2021-04-27, 18:13 UTC You are aware that Shift+click on an item in the hotlist opens the item in a new tab...?
I never paid attention that with shift modifier key you create new tab !
Many thanks @Petermad TC have so many features that we miss to update our strategies. (It will save me some time specially when two sides are defined or when i'm in a custom view with time consuming columns)

So @Ghisler(Author) ^T then ^D is less efficient that ^D and then shift ;)

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-28, 08:56 UTC
by ghisler(Author)
Yes, Shift+Click or Shift+Enter opens a directory in a new tab, both in Ctrl+D directory hotlist and Alt+F1/Alt+F2 drive dialog. I'm removing the filter in all these situations.

However, Ctrl+U and Ctrl+Shift+U will now preserve the filter when the option is enabled to have per tab filters. Reason: You essentially swap the tabs, so the filters will go with them. Previously the filters were for all tabs on that side, so Ctrl+U didn't swap them.

Re: filtering with CD kept for each tab and not for all left/rig

Posted: 2021-04-29, 23:11 UTC
by tuska
@nsp
Thanks for your persistence! :)

@ghisler(Author)
HISTORY.TXT wrote:29.04.21 Release Total Commander 10.00 public beta 8
25.04.21 Added: Configure option to save displayed file types (e.g. *.txt) separately for each tab:
              Configuration - Options - Folder Tabs - Save displayed file types separately for each tab (32/64)
25.04.21 Added: Option to save displayed file types (e.g. *.txt) separately for each tab, or same for all tabs:
              wincmd.ini [Configure] DirTabFilters=1/0 (32/64)
23.04.21 Added: Save displayed file types (e.g. *.txt) separately for each tab (32/64)
Thank you very much for the implementation! :)

I have tested a few things and noticed one thing where I think there is a need for improvement.

Test scenario:
- Button with command: em_Executable,cm_SrcViewModeList Background_GREEN
- If CTRL+U is now executed, the filter is applied but the View Mode (background colour) is unfortunately lost.

Therefore, please check for a further possible implementation.
Thank you!