Page 10 of 16

Re: Custom Columns

Posted: 22 Mar 2014 23:27
by kunkel321
admin wrote:And hey, I just took your "Context Smart Columns" -- nice catchy term! Thanks! :appl:
Very good! 8)
I must say, that I think SkyFrontier was correct in hyphenating it... "Context-Smart"

Question: Can we start building up our list of user-defined columns, or will they again get wiped out with the newer betas (as you warned about before)?

Re: Custom Columns

Posted: 23 Mar 2014 07:55
by admin
I cannot guarantee it, but you have a good chance.

Re: Custom Columns

Posted: 30 Mar 2014 23:26
by kunkel321
Coolest ever mixed columns setup:
Image

It uses the following mix hierarchy:
Image

"Dimensions" is the default one that Don has in there.

"N Icons" is a Template with
Icons: <get counticons "<cc_item>">' //Thanks for adding this Don!
Type: Files,
Filter: dll;icl

"Just size" is the plain old property "size"
Type: Files
Filter: "*.*" (actually type in the asterisk dot asterisk)

"Count" is a script CC with
$tst = "<cc_isfolder>";
if("$tst" == "0") { }
elseif("$tst" == "1") {
$files = trim(folderreport("files", "r", "<cc_item>", ""), "<crlf>");
$dirs = trim(folderreport("dirs", "r", "<cc_item>", ""), "<crlf>");
$files = gettoken("$files", count, "<crlf>");
$dirs = gettoken("$dirs", count, "<crlf>");
return "Files: $files, Dirs: $dirs";
}
//Thanks for the script SkyFrontier!
Type: Folder
Filter: Blank.

Note that you can't have two different sub-columns, each with a blank Filter field. (Even if one is "files-only" and one is "folders-only.") As such, the "Just size" column has to come first and has to filter-out any folders, by using an explicit "*.*" (The unfortunate side effect, is that if a folder has a dot (such as "My Folder 2.0") the Mixed CC will be blank for that item.

Re: Custom Columns

Posted: 31 Mar 2014 08:35
by admin
Cool indeed!
kunkel321 wrote:Note that you can't have two different sub-columns, each with a blank Filter field. (Even if one is "files-only" and one is "folders-only.") As such, the "Just size" column has to come first and has to filter-out any folders, by using an explicit "*.*" (The unfortunate side effect, is that if a folder has a dot (such as "My Folder 2.0") the Mixed CC will be blank for that item.
I might improve that in a later version.

Re: Custom Columns

Posted: 31 Mar 2014 11:48
by LittleBiG
admin wrote:I might improve that in a later version.
I also hope you will.

I tried to solve the folder size caching. Saved Folder Size (Extra 4) filler script:

Code: Select all

$token = "";
  foreach($token,formatlist(folderreport("dirs:{fullname},{size RAW}|","r",,,,"|"),"e")) {
    tag(replace(gettoken($token,2,",")," "), gettoken($token,1,","), ex4, 1);
  }
The I tried to create a mixed column from other two:
1. column for all folders: shows an already saved size from Extra 4

Code: Select all

return report("{extra 4}","<cc_item>");
2. column for all files: normal size property

These 2 cannot be shown in one mixed column. They are ok separately, so...

Re: Custom Columns

Posted: 02 Apr 2014 22:29
by admin
Tip: Thanks to the new possibility to search by custom column definition, scripted custom columns can serve as search templates for infinitely complex search jobs.

Re: Custom Columns

Posted: 09 Apr 2014 18:27
by TheQwerty
Network Locations... :x

I think we need a new variable <cc_isnetwork> so scripts can act appropriately.
It might also be desirable to include an option so CCs can be configured to "Include Network Locations".


For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.

Re: Custom Columns

Posted: 09 Apr 2014 19:16
by LittleBiG
TheQwerty wrote:For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.
I think the earlier mentioned "cc is calculated only for the visible rows" is better approach.

Re: Custom Columns

Posted: 09 Apr 2014 21:02
by TheQwerty
LittleBiG wrote:
TheQwerty wrote:For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.
I think the earlier mentioned "cc is calculated only for the visible rows" is better approach.
They tackle different issues... Only running scripts for the visible items minimizes the total amount of time required before information can be shown.

My suggestion is that there should be a way to limit the total amount of execution time for any single instance of the script (each item in the list kicks off a new instance of the script).

It's a moot example now but consider the case of a CC script that calculates a hash. The delay it adds when browsing folders containing many small files might not be bad, but navigate to a folder containing GB+ files and you can't hit Escape quick enough.


What I'm suggesting is I'd change my script to:

Code: Select all

ExecutionTimeout 500, 'skipped';
return hash('md5', <cc_item>, 1);
Now when XY executes the script if it takes longer than 500 ms to run the portion following the ExecutionTimeout SC then XY will abort the script and use the value 'skipped' - so it will be as if the script returned 'skipped'.


Admittedly, I'm not in love with this solution but I do like it better than a global configuration/tweak timeout value. Perhaps it would be better as two new options that are available in the CCC dialog for scripts. :?

Re: Custom Columns

Posted: 09 Apr 2014 22:48
by kunkel321
In regard to the slowness of certain columns: Another idea.... In the CC definition GUI form thingy, Don could have a checkbox for "[ ] This property only gets calculated on selection."

For example the Script CC that calculates "N Dirs, N Files" for folders could be marked as "on selection only." Then the folders contents don't get calculated unless I click on the item. It this were part of a Mixed Column, the fast calculations would happen straight away, but the slower ones would not calculate unless the folder/file was clicked on.

Re: Custom Columns

Posted: 10 Apr 2014 10:02
by admin
Yes, this is planned since http://www.xyplorer.com/xyfc/viewtopic. ... 35#p102035

I'm currently collecting ideas for Custom Columns 2.0.

Re: Custom Columns

Posted: 10 Apr 2014 10:04
by admin
TheQwerty wrote:Network Locations... :x

I think we need a new variable <cc_isnetwork> so scripts can act appropriately.
It might also be desirable to include an option so CCs can be configured to "Include Network Locations".


For scripts maybe we need a way to define a timeout?
Perhaps a command? ExecutionTimeout msecs, timeoutMsg;
After which if the script is still running msecs milliseconds later it is aborted and timeoutMsg is returned.
Yeah, I add it to my CC 2.0 list.

Re: Custom Columns

Posted: 12 Apr 2014 18:11
by binocular222
I suggest adding <cc_ext> variable
Instead of set up a few columns with specific ext.filter, then create mixed column to aggregate => should create only 1 scripted column which return specific data per each file extension

Re: Custom Columns

Posted: 12 Apr 2014 21:03
by bdeshi
Add Checkboxes.

Re: Custom Columns

Posted: 12 Apr 2014 21:26
by TheQwerty
Running scripts on click...
Checkboxes...


Sure sounds like maybe someone was right that extra columns and custom columns shouldn't be separate things! :whistle: :P