=====================
Power Filter v1.0 alpha 4
=====================
- 2012-12-06 -
Here's a script for a Custom Toolbar Button (CTB).
• Left Click (LC): Power Reset
=> Reset view (reset filters, view type, columns, sorting...)
• Right Click (RC): Power Filter
=> Opens a menu of filtering options
Notes:
••• Left Click (LC) - Power Reset •••
• By default, the view will be reset to "Details View" and
=> To always reset the view to "List View" and "Dual Pane", change the header of the script by setting to "1" the two tweaks resp.:
- $GEN_ListView
- $GEN_DualPane
• The columns layout will also be reset on LC, so be sure that you already have a default column layout defined.
=> If not, click View | Columns | "Define Current Column Layout as Default". (Or you can remove the first #377; line.)
• By default, when the view is filtered, a Left Click (Power Reset) will only remove the filter and won't change the view or sorting. A second LC will then reset the view and sorting (if necessary).
=> To change this behavior and have a single LC simultaneously remove the filter(s) and reset the view and sorting, change the header of the script by setting to "1" the tweak: $GEN_FullReset
••• Right Click (RC) - Filters •••
• The first "Filter Labeled Items" has two functions:
- If no item (or a non labeled item) is selected, then it will filter the view to (only) show all labeled items
- If a labeled item is selected, then it will filter the view to (only) show same-label items
=> If you want to filter only specific labels, you can change or add selfilter lines. For example, I left the one I use with "(" (my main color labels have parenthesis in their name), and I added the second selfilter with "e" (by default, all color label names contain "e").
• By personal preference, the "Filter Modified..." or "Filter Created..." are based on hours - so "Modified Today" means "Modified during the last 24 hours".
• By default, filtering by Date (modified or created)
=> To leave the view and sorting untouched, change the header of the script by setting to "0" the tweak: $GEN_DateViewSort
• By default, filtering by Label will be sorted by Label.
=> To leave the Sorting untouched, change the header of the script by setting to "0" the tweak: $GEN_LabelSort
• To force all filters by item types (Images, Audio, Video, Documents, Archives, System) to be sorted by Extension, change the header of the script by setting to "1" the tweak: $GEN_TypeSort
• To force the filter by Images to be displayed unchanged or in one of the 3 Thumbnails View, change the header of the script by setting to "0", "1", "2" or "3" the tweak: $GEN_ImgView
• To force the other filters by item types (Audio, Video, Documents, Archives, System - plus Label) to be displayed in Details or List view, change the header of the script by setting to "1" or "2" the tweak: $GEN_OthersView
Disclaimer:
- I've been using this script for a while without any problem,
- Though, know that this script is
- I may take the time to enhance it or clean it up some day... depending on its usefulness to others. Anyway, feel free to change it, ofc!
Hoping it might prove useful,
Enjoy,
Flux
--------------------------
################
### Installation ###
################
To use this script, first, copy the following file into XYplorer scripts folder: <xyscripts> , then either:
1a. add load "PowerFilter.xys", "_PowerReset"; to the "On click:" of your custom button
1b. add load "PowerFilter.xys"; to the "On right-click:" of your custom button, or
2. use the following snippet (with Don's litteral instructions):
-a) Paste ::snippet; into the address bar and press ENTER. A text box will open to enter snippet.
-b) And here comes the copy+paste ready snippet. It will create a new button at the right end of your toolbar.
Code: Select all
Snip: CTB 1
XYplorer 11.80.0, 01.12.2012 16:00:00
Action
NewUserButton
Name
PowerFilter
Icon
:visualfilter
ScriptL
load "PowerFilter.xys", "_PowerReset";
ScriptR
load "PowerFilter.xys";
FireClick
0
-------------------
############
### Extras ###
############
Here's a small pack of extra icons (for this script and others to come) • All icons (and resp. credits) are from the free collection: Open Icon Library,
- except zip.ico, rar.ico, and archives.ico (Freearc), belonging to their respective owners (I presume).
• To use with this script (you gotta deserve it!):
- Extract with folder name (i.e. in [Icons]) in your XYplorer\Data folder (<xydata>): e.g. XYplorer\Data\[Icons]
- In the script, find all menu title lines that have comments and delete the beginning title until the opening double-quotes - including the comment sign "//" AND the space behind, e.g.:
=>
"Filter Images|[Icons]\Images.ico"[/color]
-------------------------
##################
### Changelog ###
##################
v1.0a4
++ Added 5 new variables (see script header for info):
++ LC - $GEN_FullReset - "One Click" Reset Filter+View+Sorting (instead of Remove Filter, then Reset View+Sorting)
++ RC - $GEN_TypeSort - Sort all 6 Item Types by Extension
++ RC - $GEN_LabelSort - Sort Labels filtered by Label
++ RC - $GEN_ImgView - Display filtered Images in Thumbnails (1,2 or 3)
++ RC - $GEN_OthersView - Change display of other filtered items
* Renamed var $GEN_DateSorted to $GEN_DateViewSort to match new vars
* Set var $GEN_DualPane to 1 by default to comply with new XYplorer default
* Optimized all filters depending on user settings and tweaks
*! Optimized (and fixed) Power Reset (Left-Click) to be more polyvalent
* Added commented menu title entries with alternate icons, to be used with the extra icon pack
v1.0a3
! Fixed weird bug (incompatible Carriage Return could break code)
v1.0a2
+ Added "Settings" header to regroup all tweaks
+ Added Tweak to force DetailsView and Sorting for date filtering: $GEN_DateSorted
! Fixed ListView and DualPane tweaks
* Rewrote "Filter Labeled" and "Filter Commented" codes to preserve selections (when possible)
! Forced sizes to be filtered by MB whatever the column settings
! Forced dates to be filtered by full Y+H:M:S whatever the column settings
! Fixed implementation of filtering items with "[" or "]" in names
* Changed code for filtering items with "#" in names
* "Remodeled" code to make it cleaner and clearer