"My God, it's Full of... Defined Filters?"

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Post Reply
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

"My God, it's Full of... Defined Filters?"

Post by Kilmatead »

With the relative cornucopia (read: "overkill") of methods available to the keyboard-obsessed x2 user for invoking pre-defined filters, things are a little more limited when it comes to the mouse-friendly public.

Alluding to a previous thread wherein a user had wanted a toolbar button to apply a specific filter, we created a wee utility at the time that would facilitate this, albeit limited to applying one named-filter per button.

Recently I received a couple of requests to expand on this theme, to allow the user to switch between pre-defined filters simply by clicking on a "menu-style" list of filters from a single toolbar-button. As the closest thing x2 has to this at the moment is the somewhat limited View -> Visual Filter -> Auto-Filter command-menu, this seemed like a decent niche that needing filling, an itch that needed scratching, a body that needed bludgeoning, a... well, you get the idea. Boredom is ever the mother of my inventions and misdemeanours. :wink:

Image

Download: x2Filter (Version 0.5.1.6, Updated 12-Oct-16)

Image

In the interest of being as idiot-proof as possible, the list of named-filters does not need to be configured or maintained by the user, they are read directly from x2's settings - so the menu is composed of whatever hyper-filters you already use now or add/remove in the future without needing to edit anything, ever (!).

Simply define a user-command as > {Path...}\x2Filter.exe and add it to a toolbar. The menu will appear when you click it.

The filters are gleaned from x2's registry settings by default, but if you use an INI instead, simply add /INI="{Path...}\x2settings.ini" to the user-command definition. If you don't specify a target, it will find the settings file location itself.

Obviously, the filters listed first are the pre-defined hyper-filters you normally access from View -> Visual Filter -> Rule Based (or the <Alt+G>/<Alt+H> equivalents).

The "File Groups" sub-menu lists those groups defined in Tools -> Advanced Options -> Global [Tab] -> File Types (you know, the plebeian categories like "{Documents}" and "{Video Files}", etc).

Click an entry and the selected filter is automatically applied to the active pane, allowing you to switch between filters quickly using only the mouse with a minimum of fuss (only 1 toolbar button) - and no keyboard interaction at all.

x2Filter may still be used as originally designed as a means to invoke a single filter directly from a button - just add the filter-name to the user-command definition: > x2Filter.exe /Filter="Sample". If you're applying a file-"group" type filter, you must add the braces to the name: > x2Filter.exe /Filter="{Documents}", and so forth.
Last edited by Kilmatead on 2017 Mar 18, 17:00, edited 6 times in total.
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Re: "My God, it's Full of... Defined Filters?"

Post by dunno »

Many thanks for this.

Is there a way to rename the standard "smaple" filter ?, I like the filter but want to rename it to "Recent", or perhaps "Modified"
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: "My God, it's Full of... Defined Filters?"

Post by Kilmatead »

dunno wrote:Is there a way to rename the standard "sample" filter?; I like the filter but want to rename it to "Recent", or perhaps "Modified"
A simple way is just to delete the Sample one and then create one of your own with the same rules. Or, just go into the registry and rename the "Sample" entry under:

HKCU\Software\ZabaraKatranemia Plc\xplorer2_UC.global\Hyper filters

...or the equivalent in the INI, under "[xplorer2_UC.global\Hyper filters]"
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: "My God, it's Full of... Defined Filters?"

Post by Kilmatead »

Due to bugfixes in x2 2.4.0.0 there has been a small update to x2Filter (see original post for download).

Changes include:
  • Holding <Ctrl> when selecting a filter will Highlight/Select the matching objects instead of completely hiding all non-matching objects by default

    Re-enabled the "File Groups" submenu for scrap/miniscrap panes

    Added command-line option "/Select" so highlighting-only is the default action, and holding <Ctrl> will instead reverse that
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: "My God, it's Full of... Defined Filters?"

Post by Kilmatead »

Just because it's Christmas day, and I obviously have nothing better to do, x2Filter gets yet another update, with the usual additions/fixes, etc.

There's now a direct link to the Filter Dialogs in x2 (if you hold <Shift> while selecting an entry, that particular filter's definitions are automatically opened and focused for editing), making quick adjustments to the filter itself a lot easier.

Since some users found the idea of holding <Ctrl> to only highlight matching items a little a hard to remember :shock:, there's now a checkbox-entry within the popup-menu itself which may be toggled before selecting a filter, to get the desired result in a "more obvious and friendly" manner. :D

And, even stranger, for a utility that was originally aimed at mouse-users, it appears (from requests) that quite a few people use it directly from the keyboard as well, so a few options have been added for them... the ability to have enumerated accelerators for the first 10 entries displayed on either the left or right side of the menu (see /Accel), similar to how the bookmarks menu in x2 does it. And instead of the popup appearing where the mouse-pointer is by default (usually the toolbar-button), the menu can be set to open specifically within the active pane itself customised to edges (see /PaneMenu).

As usual, the full changelog is at the top of the source-code, and the original post in this thread has been updated for description, download link, and pictures (where would we be without screenshots? :wink:).

Enjoy.
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: "My God, it's Full of... Defined Filters?"

Post by Tuxman »

Ewww. If I were you, I would strongly discourage using the mouse, thus deny such features.
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: "My God, it's Full of... Defined Filters?"

Post by Kilmatead »

Like I said, the extra keyboard-centric features were added because keyboard-users (not me!) requested them - apparently even heathens like having filters available in a simple popup. Personally, I'm happy enough with a mouse, but unlike some people, I'm not evangelistic in my crusade to convert the evil-doers, and take a more egalitarian approach to such things (why else would I accede to their iconoclastic requests?).

:shrug:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: "My God, it's Full of... Defined Filters?"

Post by Tuxman »

It's not a crusade; I just like getting things done fast. Ctrl+T in Firefox instead of "mouse - File - click - New Tab - click". A mouse has certain advantages, like drag&drop, but I'm positive that using a file manager with a mouse is just slowing things down. I know a couple of Total Commander users. I don't even know if they have a mouse. :?
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: "My God, it's Full of... Defined Filters?"

Post by Kilmatead »

Given that some laptops don't even have clearly defined directional-keys (they're all mashed together so designers can waste their lives designing more perfect bezels) and you have to hunt through dangerous and dark forests just to find the "context-menu" key:

Image

...and trackpads are so obviously a technology from hell, I'll keep my mouse, with its friendly little wheel and 5 extra programmable buttons to help me vanquish the friendly natives with syphilis and small-pox.

Some things don't seem to be designed for keyboards at all, like those bloody ubiquitous track-bar slider thingies - they've been around for 19 years and they still don't work naturally without mouse (nor, sometimes, even with one).

Unluckily for you, the computing world does not seem designed around VIM and FAR and the CLI. :wink:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: "My God, it's Full of... Defined Filters?"

Post by Tuxman »

Kilmatead wrote:Some things don't seem to be designed for keyboards at all
... like Word 2013 which is actually funny for a word processing software. You can't even indent list items by "Tab" anymore.
Kilmatead wrote:Unluckily for you, the computing world does not seem designed around VIM and FAR and the CLI. :wink:
At work I almost exclusively use Emacs for anything (except the things I do with my web browser). No toolbar enabled. 8)
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: "My God, it's Full of... Defined Filters?"

Post by Kilmatead »

nikos wrote:...you can trust kilmatead for an overengineered solution any day of the week...
In the grand tradition of continuing to bring over-engineered solutions to the huddled-masses, the link in the first-post above has been renewed to reflect a substantial new update for this utility, adding in several stock-filters, bug-fixes, and the usual general mayhem.
Changelog for 0.4.0.1 wrote:Added: All extensions found in the active pane are now added to the File-Groups submenu for quick-selection
Added: Unique Basenames [S] filter as stock [/Filter="Basenames"]
Added: Export Paths [S] option added to selections submenu for UTF-8 format exporting [/Filter="Export"] (hold <Shift> when selecting to show options
Added: Oecumenical Hidden [S] (main filters menu) Toggles the display of hidden files in both panes at the same time [/Filter="Hidden"]
- All selections in all tabs are preserved (up to 50 tabs with 5000 selections each) even if the pane-style is auto-reverted to default (desktop.ini) settings
- Focused (but not selected) items retain their non-selected state and are not mysteriously auto-selected as x2 does by default
Added: Safe Refresh [S] (main filters menu, disabed by default) Refreshes the pane while retaining all current selections, not automatically selecting the focused item [/Filter="Refresh"]
Added: Stock x2 selection commands added as popup submenu: Hard-filter (current selections), Select All, Deselect All, Invert selections
Added: Exclude Filter/Group toggle (as an Anti-Filter) included in menu to remove (hide) any file-group or filter results [bStockExcludes]
Added: Settings are stored in an INI for persistence within the utility's folder
Added: INI section [MenuItems] holds keys which determine which filters/extras actually appear in the menu, allowing the user to remove clutter they may not want
Added: Any filter invoked with Mark/Select forces the first matching (selected) item to actually be visible in the listview (x2 itself doesn't do this by default) [bEnsureFirstVisible]
Added: /Amalgam command-line option to amalgamate any submenu entries into the main menu instead of (default) being separate menus
Added: Tooltips for stock filters and {File-Group} entries [bShowToolTips]

Fixed: Explicitly named filters (via /Filter) did not maintain a predictable default Mark/Select status when invoked (now always hard-filtered unless /Select is used)
Fixed: Multiple issues with how the x2 display is updated visually during processing (flickering, shifting, control refocusing, etc)
Fixed: /INI didn't follow x2's order priority when self-determining the settings file location ( see http://forum.zabkat.com/viewtopic.php?f=18&t=9820&p=60589 )
Fixed: Mark/Select would clear an existing filter before highlighting the new one (now the action is complementary by default rather than exclusive) [bSelectIsExclusive]
Fixed: Modifier-keys wouldn't properly apply when filters were assigned directly through the CLI
Fixed: Old masking text in the filterbar would remain visible even after a filter was explicitly cancelled

Changed: Filters and active-pane detection now directly invoked via the proper x2 control (using API) - much more reliable than firing <Enter> into a focused control
Changed: Menu item name Highlight/Select changed to Mark/Select for consistency and is now sticky by default [bSelectIsSticky]
Changed: /Filter=<Name> is now used to pass named filters/commands directly (no menu popup) via CLI
A couple of notable stock filters added include Unique Basenames [S]:

Image

Please see this thread for more detailed information about using this filter and how/why it was created and added to this utility.

...and Export Paths [S]:

Image

...and Oecumenical Hidden [S] which will universally toggle the display of hidden files while retaining the user-selections in all tabs/panes. And yes, I really do stay up all night thinking up wacky names for these things - it's my ultility, I'll call 'em what I want, as it can never hurt someone to learn new words. :wink:

There is also a Safe Refresh [S] filter which does the same for refreshing the current pane, but it's disabled by default because it's not really a filter - but it's there if someone wants it.

Enjoy. :D
Post Reply