[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, Hacker, petermad, Stefan2

Post Reply
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

Yipeeh! I have my own windows-independent libraries. :D

It's not so easy to understand, but with a little help it's finally a powerful tool for "non-programmers".

Thanks to MVV for this wonderful plugin.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ate,
Enjoy :)
If you get some ideas - post it!

Also I suggest to make backups of default state file sometimes (or just to save separate state via <save command).
Last edited by MVV on 2009-11-03, 19:20 UTC, edited 1 time in total.
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

Hmm... two minor problems.
MVV wrote:This is the right setting! You need to set only filename.
The script >Aktuell starts only with AutoUpdateName=>Aktuell and not with AutoUpdateName=Aktuell

My settings in the fsplugin.ini are now:

Code: Select all

[Virtual Panel]
AutoUpdateScriptName=>Aktuell
EnableAutoScripts=1
DefFileList=%Commander_Path%\Log\virtfilelist.txt
LogPath=%Commander_Path%\Log\VirtualPanel.log
LogEnabled=1
VirtualFolderIcon=
1.) I got all my movie-folders in the virtual folder Videos (like Videos\Movie1, Videos\Movie2 ...). But If I change to these subfolders (Movie1, Movie2 ...) I get (again) the error:

Code: Select all

Error in batch file! Script should begin with '<'! 
\Videos\Movie1\>Aktuell
After confirm O.K. I can change to this subfolder (e.g. Movie1) without a further error-message.

2.) If I copy a folder (e.g. MovieTest) to the real movie-folder (e.g. D:\Filme\MovieTest), I see this folder in VP after a refresh. Fine. But if I delete the real folder MovieTest (in "real" TC and not over the VP), then the folder MovieTest is still shown in VP after a restart.

I hope, you can understand my lousy English and help me again.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ate wrote:The script >Aktuell starts only with AutoUpdateName=>Aktuell and not with AutoUpdateName=Aktuell
Yes, because filename is >Aktuell and not Aktuell.
ate wrote:But If I change to these subfolders (Movie1, Movie2 ...) I get (again) the error:

Code: Select all

Error in batch file! Script should begin with '<'! 
\Videos\Movie1\>Aktuell
I see, thanks for this report. Seems that plugin tries to execute non-existent script file. I'll fix it in next version.
ate wrote:If I copy a folder (e.g. MovieTest) to the real movie-folder (e.g. D:\Filme\MovieTest), I see this folder in VP after a refresh. Fine. But if I delete the real folder MovieTest (in "real" TC and not over the VP), then the folder MovieTest is still shown in VP after a restart.
This happens because you specified wrong mask for <del command. Seems that your <put command adds * and your <del command removes *.*. So, your <put command adds all folders but <del command doesn't remove them because mask *.* doesn't match. So, you need to turn eas off, to change <del *.* to <del * in script, to set read-only attribute for script and to turn eas on again. Or you may set mask like *.* for <put command - so it won't add folders.
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

Write-protected script >Aktuell with <add \Videos\>Aktuell {<silent <del * <put . D:\Filme\*.* <put . E:\Filme\*.*}
works now - exept the reported error-thing - as I want.

Thank you.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ate wrote:exept the reported error-thing
Fixed. :)

New version 1.0.0.166:
* error opening script file mesage if file doesn't exist
* error copying file within VP - file was moved instead
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

MVV wrote:Fixed. :)
Confirmed. :D

Is there a chance to permanent rename the folders in the VP (e.g. Movie1 to MyMovie1) ? Now I must change to the real folder and do it there.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ate wrote:Is there a chance to permanent rename the folders in the VP (e.g. Movie1 to MyMovie1) ? Now I must change to the real folder and do it there.
If you mean folder inside virtual folder, you can. But if you mean folder inside real folder, its impossible because it just shows contents of real folder. So, you can't rename any folder or folder inside of folder that was auto-created using <put command. You may rename only thoose folders that you created personally (via F7 or copy).
gsi
New Member
New Member
Posts: 1
Joined: 2009-11-23, 07:26 UTC
Location: Russian Federation

Post by *gsi »

Is it possible to make a saved file (with a certain extension) be imported to Virtual Panel through pressing the Enter key so that the user could enter this file as you enter the folder the same way it is implemented in a relevant plug-in of Far Manager?
The existing import option is not convenient for work. If you improved your plug-in as proposed above, it would become invaluable.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

gsi wrote:Is it possible to make a saved file (with a certain extension) be imported to Virtual Panel through pressing the Enter key so that the user could enter this file as you enter the folder the same way it is implemented in a relevant plug-in of Far Manager?
The existing import option is not convenient for work. If you improved your plug-in as proposed above, it would become invaluable.
I think its bad idea 'cause FS plugin is very limited in functions. You can't call VP scripts or use any other functions if you have no VP panel active. Sorry.

But wait, I have some workaraund.

I will describe how to open contents of .LST files in VP on Enter.

1. You need to enable enter folder autoexecution of event script. Open your plugin INI file (if you don't know its path use <prop command) and change parameters (close TC before): AutoUpdateScriptName=>Refresh, EnableAutoScripts=1 (or other odd value - read help file for details).
2. You need to think out some special place on your disk for file that will be loaded automatically when you will enter some special folder. Let it be "%TEMP%\AutoLoad.lst". And special folder e.g. "\Loaded".
3. You need to create that special folder and event script to load that file when you enter that folder. Use batch (execute it from command line within VP):

Code: Select all

<add \Loaded<add \Loaded\>RefreshNew {<silent<del /r \Loaded\*<load "%TEMP%\AutoLoad.lst" \Loaded}
Set read-only attribute for new script file to protect it from deletion by itself and rename it to >Refresh. Now you have special folder \Loaded that shows contents of file %TEMP%\AutoLoad.lst every time when you enter it or refresh its contents.
4. Prepare simple BAT file that will copy passed file to our special file and then tell to TC to open our special folder! File may have following contents (of course you need to specify full path to TOTALCMD.EXE file):

Code: Select all

@echo off
copy /Y "%1" "%TEMP%\AutoLoad.lst"
start "TC" C:\TOTALCMD\TOTALCMD.EXE /O /S /L="\\\Virtual Panel\Loaded"
5. Now you need just to associate created BAT file with .LST files using Internal Associations dialog! Just define new mask *.LST and enter an Open action like this: "C:\TOTALCMD\LoadLst.bat" "%1"

That's all! When you press Enter on any .LST file, TC will enter \Loaded folder that will show contents of that .LST. Note that you may return to previous folder by Alt+Left (i.e. Go Back command).
Of course, you may choose any event file name, special folder name and special file place. I hope you'll understand this. :)

If you want to run BAT minimized, create LNK for it and set in its properties Minimized state, and use this LNK file instead of BAT in Open action.

The only problem that I see is if loaded state file will have some read-only files they won't be removed automatically from \Loaded folder when you open another state.
Roko
New Member
New Member
Posts: 1
Joined: 2009-12-07, 12:09 UTC

Post by *Roko »

Hello. I use this plugin. I found a minor bug.
if I rename a folder or a file change only letter caps (GAme -> Game) in virtualpanel, an error occurs

"Cannot write \\\Virtual Panel\GAme! Please remove the write protection!"


Thanks to MVV for this plugin.

(and sory my bad english)
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Roko wrote:Hello. I use this plugin. I found a minor bug.
if I rename a folder or a file change only letter caps (GAme -> Game) in virtualpanel, an error occurs

"Cannot write \\\Virtual Panel\GAme! Please remove the write protection!"
It's a misfeature, I know about it:)
The problem is that case changing is the only case when target object may exist and shouldn't be replaced so change case requires completely different procedure ('cause file system isn't case sensitive and case may be changed in any part of path - so we need to find and rename all objects) than regular move. Maybe I'll change it. Currently you may change case of characters by renaming to other name (e.g. to GAme_ and then to GAme).
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Why not do that as the actual implementation?

When rename is called check if the lowerCased string is the same in both New & Old filename. If so do a multistep rename.

I seem to recall having to do that under Win98 when I wanted to change the Letter Case of files.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Balderstrom wrote:When rename is called check if the lowerCased string is the same in both New & Old filename. If so do a multistep rename.
TC doesn't say if it tries to rename only, it just asks for moving in function FsRenMovFile.

I think it is quite ugly to add into a FS separate function just for changing case of characters. So I wanted to do it in right way. I've added rename possibility in latest build, FsRenMovFile tries to rename (move) all names from last to first and move method uses existing folder object if available.

I think I'll post new version today. Thanks if you like my plugin:)


VirtualPanel 1.0.0.170: added change case only renaming, some fixes (e.g. for extra autoexec script message).

Hope I didn't added new bugs while fixing old:)

Next version will use INI near plugin if this file exists.
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

Tnx. Going to test :)
Post Reply