[WFX] VirtualPanel: Temporary panel for TC

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, sheep, Hacker, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8121
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

[WFX] VirtualPanel: Temporary panel for TC

Post by *MVV » 2009-10-10, 08:46 UTC

VirtualPanel is a temporary panel plugin for Total Commander. It is is a sort of virtual folder that allows keeping links to frequently used files and accessing them as if they were real files and not just links. It doesn't store any files, it only keeps links to them in special list files.
You can use VP as a temporary place for files that should be copied to some other place. Also you can use it for organizing media libraries and for other needs. You can even set up some folder for collecting files from multiple folders on your PC.

VirtualPanel was created because none of previously existing analogs include all temporary panel features provided by TC.

If you have some suggestions not listed here, or some troubles, fell free to post it. :)

You may read about issues with file system and temporary panel plugins here. Also, dicsussion on Russian board is here.



Last version information

Version no: 2.0.7 32/64
URL: VirtualPanel at wincmd.ru / VirtualPanel at totalcmd.net

Requirements: operating system Windows 2000 and above, Total Commander :)

Features:

+ keeping links to files and folders, and virtual folders
+ saving VP state on exit TC or Windows, by timer or after each modification
+ import/export of whole contents or separate directories
+ import/export of usual filelists (like m3u)
+ correct copy/move operations processing
+ deleting real files when Shift key is down
+ logging file operations
+ internal commands for extra functions (execute ? command for help)
+ ability to execute command batches and create script files
+ autoexecuted scripts on load state or enter directory
+ support for executing scripts remotely
+ virtual explorer with drag-and-drop support
+ multi-threading support (background operations in TC 7.55 and later)
+ support for internal associations in TC 7.51 and later
+ support for standard cd command in TC
+ full Unicode support


General information:

File system may contain three general types of objects: virtual object (file or folder, have no real target), link to real object (file or folder, have real target) and real object (you see them when enter folder link). Virtual files may contain scripts, virtual folders are really useful for real links orderliness and sorting, you may create, rename/move or delete them. For links all usual operations are available - browse (for folders), open (Ctrl+Enter, Enter for folders), view, open properties, copy/move to normal panel or another real folder of VP, delete. When you delete link to real object, just link is deleted. If you want to remove also target, hold Shift to see confirmation message. When you delete real objects (inside of real folders), plugin will warn you always.

You may add links to your programs and data files like playlists, images or music or video files or whole folders, also you may execute any command line within plugin, and it will be executed as if it was executed in real folder that your current virtual path points to. If you are in virtual folder, only internal commands and open command are available (you may enter relative path of file/folder in virtual system or absolute - start it with '\' character or just use Ctrl+Shift+Enter).

When you copy files to VP, action depends on target folder type. If you try to copy files into virtual folder, files will be just added to virtual system. If you copy files to folder that has real target, files are copied to real folder. When you add real folder into virtual volder, TC creates virtual folder structure similar to structure of source folder and adds files to it. If you need just to add real folder as link to it w/o adding whole its structure, you should use internal command <add (currently TC doesn't allow to use another way).

Configuration file

By default, TC tells INI file path to plugin (since TC 5.51). But plugin (since VP 1.0.0.180) will use INI file with plugin's name in its folder (if file exists). If you have this file but don't want it to be used as configuration file, you may delete it.

Language files

You may add own translation for plugin messages. Language files should be placed into Language folder near plugin. You may use <lang command to switch language (plugin will save your choice in configuration file). Russian and English messages are embedded in plugin by default.

Internal commands:

Plugin has some internal commands that let to use some unsupported by TC FS plugins features such as adding/removing link to real folder and to setup some settings. Theese commands are started with '<' character. You may execute internal command "<?" (w/o quotes, of course) in command line when you're in plugin panel to see list of supported internal commands. Also you may open plugin properties to get some useful information like path to INI file, path to log file etc. If some parameters contain only one '?' character, they will be asked during script or command execution. If your path to real file contains braces, it must be double-quoted.

Log file and special icons:

By default, virtual folders have a bit brighter folder icon bordered with red. You may change this icon by editing INI parameter VirtualFolderIcon. You should specify path to file containg icon, and optional icon index after comma.

If you want to log operations within plugin, you may enable log file with internal command <log. You should edit INI parameter LogPath if you want to change path to log file or use command <log with path to a file. You may set log file size limit (since VP 1.0.0.416).

There are 4 groups of logged events that may be enabled/disabled by specifying corresponding mask: 1 - actions, 2 - status messages, 4 - attributes setting, 8 - find operations. To enable all events you may use -1 value as mask.

Links to physical files/folders that are inaccessible are displayed with special striked icons. You may redefine icons in INI.

Internal scripts:

You may execute scripts up to about 2048 characters long. Scripts may be executed via command line or from special script files. Such files must have '>' as first character of name. Script contains sequence of internal commands w/o separator, new command finds by '<' character. If you want to create script file, you must enclose each nested script with braces (nested blocks are possible). If file script ends with <<<path_to_icon_file>, file will have specified icon, also you may specify icon index after comma. Script example: <add "\>Create Save Item" { <add >Save { <silent <save ? <<C:\TOTALCMD\TOTALCMD.exe } } <<C:\Windows\System32\SHELL32.dll,12.
You may see script contents by F3 (in error message :)) or in [=ntlinks.Obj_RealPath] field (read below).
Script files may be executed from any virtual folder (via relative or full path) - it will be treated as working folder for script. Also you may execute any script from command line, not only single command.

Plugin supports two events that may automatically execute scripts - loading state file (script file should be placed into root folder of state file and have name >Autoexec) and entering virtual folder (filename may be specified in INI file). Theese events may be used for refreshing folder contents on entering e.g.

Using attached tool VPBatch you may execute scripts from TC toolbar - e.g. to add folder link to VP.

Import/export state and autoloaded state:

Plugin lets to load and save contents of virtual system via corresponding internal commands, so you may have a lot of its states (even more, you may import/export separate folders). Also you may specify default file for virtual system state, this file will be used to save state on exit and to load it on plugin load. Latest VP versions allow to save state automatically on exit Windows or by timer. You may read more about internal commands few paragraphs above.

Unicode support:

Plugin was rewritten, all basic functions are converted to Unicode versions, and added ANSI stubs that will call base functions on older TC versions (since VP 1.0.0.300). State files are now saved in Unicode, but plugin may load state files and playlists in ANSI, UTF-8 or Unicode (encoding detected by BOM). If you want, you may also convert to Unicode configuration (be careful if it is used by other plugins) and language files.

Content fields information:

Plugin has no content fields, I don't see necessity in it. If you need to know real path to file/folder, you may use pair of standard TC fields [=tc.path][=tc.fullname] or [=ntlinks.Obj_RealPath] field of my plugin NTLinks (in this case path will be free from any reparse points, also this way allows to see scripts).You should switch file system to <General> to setup custom column configuration. You may use your favorite content plugins to get other fields for real objects within plugin - e.g. field [=tc.comment] to see comments for your favorite files. :)

Virtual Explorer:

Virtual Explorer allows to perform base operations with files - launching, renaming, deletion and drag-and-drop to external windows or another Virtual Explorer windows. You may see supported shortcut keys in Readme.txt file.


Here is a sample BAR file to use main VirtualPanel script features. First and second letter of hint shows active and inactive panel's kind ('V' - virtual panel, 'P' - normal panel).

Code: Select all

[Buttonbar]
Buttoncount=18
button1=WCMICONS.dll,3
cmd1=%COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VPBatch.exe
param1=^explore .
menu1=V>V  Virtual Explorer
button2=
iconic2=0
button3=WCMICONS.dll,65
cmd3=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param3=/c"Add as link to virtual panel" /t"%%${}Path%%\"%N /p"Add "%N" as:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^add "%%1" %P%N
iconic3=0
menu3=P>V  Add object to virtual panel...
button4=WCMICONS.dll,63
cmd4=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param4=/c"Move within virtual panel" /t"%T"%S1 /p"Move "%S1" to:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^exec { ^move %S1 "%%1" }
iconic4=0
menu4=V>V  Move object...
button5=WCMICONS.dll,64
cmd5=%COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VPBatch.exe
param5=^ifok "Remove %%${}Path%%\"%S1" from virtual panel?" { ^del /rd %S1 }
iconic5=0
menu5=V>X  Remove virtual panel object
button6=WCMICONS.dll,28
cmd6=%COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VPBatch.exe
param6=^edit "%S1"
iconic6=0
menu6=V>V  Edit target/script...
button7=
iconic7=0
button8=WCMICONS.dll,63
cmd8=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param8=/c"Move target object" /t%P%N /p"Move target for "%S1" to:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^tgmove %S1 "%%1"
iconic8=0
menu8=V*P  Move target object...
button9=WCMICONS.dll,32
cmd9=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param9=/c"Rename object with target" /t%S1 /p"Rename "%S1" with target to:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^tgmove %S1 "%%1" ^move %S1 "%%1"
iconic9=0
menu9=V*P  Rename object with target...
button10=
iconic10=0
button11=WCMICONS.dll,4
cmd11=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param11=/c"Loading state file" /t%P%N /p"Enter state file path:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^load "%%1"
iconic11=0
menu11=P>V  Load state file...
button12=WCMICONS.dll,76
cmd12=%COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VPBatch.exe
param12=^ifok "Remove all contents of %%${}Path%%?" { ^del /rd "%%${}Path%%\*" }
iconic12=0
menu12=V>X  Clear current folder...
button13=WCMICONS.dll,51
cmd13=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param13=/c"Loading state file into folder" /t%P%N /p"Enter state file path to add to %%${}Path%%:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^load "%%1" .
iconic13=0
menu13=P>V  Load state file contents to current folder...
button14=
iconic14=0
button15=WCMICONS.dll,50
cmd15=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
param15=/c"Export file paths list" /t%P"%O".m3u /p"Path to list of MP3-files from %%${}Path%%:" "%%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\VPBatch.exe" ^export /a "%%1" . *.mp3
iconic15=0
menu15=P<V  Create M3U-list with MP3-files from current virtual folder...
button16=
iconic16=0
button17=WCMICONS.dll,34
cmd17=%COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VPBatch.exe
param17=^prop
iconic17=0
menu17=Preferences
button18=WCMICONS.dll,34
cmd18=%COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VPBatch.exe
param18=^config
iconic18=0
menu18=Settings
Please specify your paths to VPBatch and AskParam if you use it.
Last edited by MVV on 2016-10-25, 07:30 UTC, edited 80 times in total.

User avatar
Samuel
Power Member
Power Member
Posts: 1856
Joined: 2003-08-29, 15:44 UTC
Location: Brandenburg, Germany
Contact:

Post by *Samuel » 2009-10-10, 11:27 UTC

To install I had to rename the dll to a wdx file inside the cab.

First impression: works good.

Second impression: aren't the virtual folders automatically stored between TC sessions? :shock:
Do I have to customize that anywhere?

User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom » 2009-10-10, 11:56 UTC

The plugins thus-far for virtual folders have been less than promising and have seen no development in years.

Shall be playing around with this shortly. Looks very promising, thanks.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.

User avatar
MVV
Power Member
Power Member
Posts: 8121
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-10-10, 12:35 UTC

Oh, sorry. I forgot to rename DLL to WFX. :)

To save state you need to setup default filelist via command <defl. Did you read information? :)
If you set default filelist as read-only, it will be only loaded, not saved.

I try to speed-up saving of large structures. Also not all contents is loaded from large file - e.g. I save list, get 10 MB file with ~41K of items, when I load it, I get only ~25K items in virtual system. Maybe here some troubles with my buffer.

When I tried to add fstream for exporting items, DLL size become 150 KB instead of 90. :shock: And I didn't get extra boost... 2,5 sec with uncached WriteFile and 5 sec for fstream... for saving of ~25K of items.

Also sometimes TC can't remove large ammount of folders, I don't know why, but <del <folder_name> -r works fine. :)
Last edited by MVV on 2009-10-10, 13:25 UTC, edited 3 times in total.

User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC » 2009-10-10, 13:04 UTC

This looks very promising, but I am confused how to execute internal commands.

For instance, please explain how to issue "<?" or "<defl"

Thanks!!
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric

User avatar
MVV
Power Member
Power Member
Posts: 8121
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-10-10, 13:11 UTC

Just type <? and press Enter when you have panel with VP active. You'll get help on all internal commands. :wink:

You'll see that in order to use <defl command, you should execute following command:

Code: Select all

<deflist <filelist_path>
E.g.:

Code: Select all

<deflist C:\Windows\Temp\default_list.lst
Also you may use <defl command because I check only first 4 characters of command name to find out command type.
And, you may edit INI file in order to setup default filelist (but you shouldn't load plugin before, or it will revert changes on exit). :wink:


Phew! I found a little bug in my buffered file read. It occured if string end was at the buffer end and first character of new buffer was 0x0A. In this case function didn't skip this character and couldn't find new line to load.

Fixed version is available. It uses 8 KB buffer for file loading (previous used 4 KB). About 3.5 sec on exit for saving ~42K items, less than 0.5 sec to load all ~42K items. Also plugin DLL renamed to WFX, as need. :)

VirtualPanel 1.0.0.36: http://files.wyw.ru/wyw_file?id=3993310 (MD5: 2C4DC6A3C25CF7AA3E0A09E9048CA31B) :wink:
Last edited by MVV on 2009-10-10, 17:03 UTC, edited 1 time in total.

User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC » 2009-10-10, 15:03 UTC

Hmmm. Doesn't work that way for me.

It must be necessary to disable the QuickSearch/Filter thing, first?
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric

User avatar
Hacker
Moderator
Moderator
Posts: 11025
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker » 2009-10-10, 15:24 UTC

JohnFredC,
Well, you need to type it into the command line, whichever way you activate it. (Shift-Left eg.)

MVV,
Would it be possible for you to implement those commands as pseudo-files, as it is done in the CD/DVD Burner plugin? It is much more convenient. Those special files can be "executed" (you can press Enter on them) and they perform special functions, like Start burning in that case. They are denoted by a leading "** " so it's something like "** Start burning". I am sure you get the idea. ;)

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

WhACKO
Junior Member
Junior Member
Posts: 67
Joined: 2009-04-07, 11:17 UTC

Post by *WhACKO » 2009-10-10, 15:48 UTC

Love this plugin, since I'm using it to display movies folders from different hdd drives, I would love a way for it to refresh the file/folder structure on start up, maybe defining the root folders to show:

eg I have d:\Movies and e:\Movies, and I want to show both of the locations in one virtual Panel folder e.g. Movies, and have the list refreshed on demand, but on first start of the plugin to have it auto update itself.


Also is there a way to display file comments?

Thanks in advance :)

User avatar
MVV
Power Member
Power Member
Posts: 8121
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-10-10, 16:48 UTC

Hacker wrote:Those special files can be "executed" (you can press Enter on them) and they perform special functions, like Start burning in that case. They are denoted by a leading "** " so it's something like "** Start burning". I am sure you get the idea. ;)
The main problem is that commands have parameters. I wanted to use user-commands for this purpose but TC don't pass commands to plugin. I described this in my TP suggestions topic. I think if TC will support passing user-commands to FS plugin, we won't need extra files because we can add needed commands to dirhotlist/button bar etc (maybe even special drop-down menu within buttonbar :)). Also in this case we'll may add params like %P%N to commands, so it will be very great for us. :)
You already may create files with names like "<save" in virtual folders but currently no action occurs when you execute them. Perhaps plugin should execute such files as internal commands? Also maybe such files need special icon. You may even create folders with such names but if you press Enter on them, TC will just open it as a folder (I mean TC will try to browse it via FsFind{FirstFile|NextFile|Close} and not to execute command via FsExecuteFile). Such commands will work only if you'll press Ctrl+Enter and Enter.
WhACKO wrote:I would love a way for it to refresh the file/folder structure on start up, maybe defining the root folders to show:

Also is there a way to display file comments?
Currently there is no way to have more than one real target for folder because plugin uses Windows's FindFirstFile for real folders. Maybe I'll think about how this may be implemented within current my virtual sytstem structure. Better way is to add into TC support for Ctrl+B in FS plugins - it will solve your problem. :)

You may add custom column for field tc.comment (you should choose <General> as file system for custom columns) and TC will show your predefined comments for real files. :) Also you may use all other fields - they should work. I wrote about it in first post.
You should define comments for files within real panels because TC don't allow to edit comments within FS plugin (BTW, you may edit descript.ion file directly). You may do this by pressing Ctrl+Z (by default) after selecting a file.

User avatar
Hacker
Moderator
Moderator
Posts: 11025
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker » 2009-10-10, 17:19 UTC

MVV,
Perhaps plugin should execute such files as internal commands?
I think that's the idea of the Burner plugin, too.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

User avatar
MVV
Power Member
Power Member
Posts: 8121
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-10-11, 09:47 UTC

I added possibility to specify virtual folder icon index (as usually, after comma).

Now I'm working on adding batch files. They are pseudo-virtual files. They have real path field but it contains script to execute. Script has following syntax: <command 1 [with parameters][<command 2 [with parameters]][<...][<<<file_icon_path>]. E.g., file >Save list (name must have '>' as first character) with script in real path field <save<<C:\TOTALCMD\TOTALCMD.EXE,0 will have diskette icon and will save VP state. If icon file is not specified, default icon will be used.

Such files will allow to execute internal commands. E.g. to add to a virtual folder files from some real folders (e.g. videos). :wink:
Last edited by MVV on 2009-10-11, 10:49 UTC, edited 1 time in total.

Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher » 2009-10-11, 10:42 UTC

2MVV
Thank you for your work.
I would like to see unicode support in your plugin.
2. Autosave state on exit marked with current date and time (optional).
3. *.m3u import/export if possible.

Works good so far :)

User avatar
MVV
Power Member
Power Member
Posts: 8121
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-10-11, 11:06 UTC

Postkutscher wrote:I would like to see unicode support in your plugin.
2. Autosave state on exit marked with current date and time (optional).
3. *.m3u import/export if possible.
1. Unicode requires to change all internal structure and list file format from 1-byte to 2-byte. Maybe I'll add it later.
2. Maybe I'll do it. Perhaps with file number instead of date because date will be same as file date. In this case it will be easier to load last user state (with max number). BTW, I think thay you may use external script to copy existing list file after closing TC (or before saving) - simple batch will do this task w/o changing in plugin. :)
3. Currently you may open list file in Excel e.g. and select third column to make filelist. Maybe I'll add command to direct export to m3u (just real path column), but m3u may contain relative path so file path should be used also in this case. Now you may use Ctrl+B and cm_LoadSelectionFromFile to select files in m3u.

User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC » 2009-10-11, 12:50 UTC

2Hacker

Thanks, I was reversing the initial character. My brain is getting old(er), sadly.

2MVV

I have already started integrating VirtualPanel into my workflow. This is a much needed TC plugin. Thank you for contributing it to the community!
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric

Post Reply