News:

MultiCommander v16.6 is released!

Main Menu

Toggle filter function

Started by matm, November 20, 2011, 21:15:19

Previous topic - Next topic

matm

Hello

I would like to have a button that toggle display filter on/off. for this to work, I need to know the state of my filter.
Is there some MC.Explorer.GetViewFilter  that can retrieve the current filter, or a way to test if a certain kind of file is displayed ?

I would expect doing something like that :

@var $filter = "-*.log"

if ( StrIsEqual({MC.Explorer.GetViewFilter}, $filter))
{
     MC.Explorer.SetViewFilter FILTER={$filter}
}
else
{
    MC.Explorer.SetViewFilter FILTER="*.*"
}


Is there already some stuff to do that ?

Regards

Mathias (yes, you read well)

matm


Mathias (Author)

#2
No there is no "MC.Explorer.GetViewFilter" But sounds like a good idea to add.

I will add that to the next release.


(edit)
After thinking about it, It might not be so easy to fix. This "Custom commands" can not return sometime to the script engine.  Yet.
But I will see if i can figure out a solution for it.

Mathias (Author)

In the latest Beta RC (874)

this can work now.

@var $filter = "-*.log"
@var $currentFilter;
MC.Explorer.GetViewFilter
$currentFilter = $__CMDRESULT;

if(StrIsEqual($currentFilter, $filter))
{
  MC.Explorer.SetViewFilter FILTER="*.*"
}
else
{
  MC.Explorer.SetViewFilter FILTER={$filter}
}


matm

Nice. That's great !

TY

When do you plan the next stable (even a range) ? :)

Mathias (Author)

Va none beta version of 1.2.1 is planed for this weekend. (today or tomorrow)