New command cm_UpdateQuickViewWindow

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

New command cm_UpdateQuickViewWindow

Post by *Vochomurka »

In the quick view mode, when the file is updated by an external program, its quick view is not updated automatically, and that's reasonable. But the only way to see the updated view is to move cursor up & down (or down & up), or give the cm_SrcQuickview command twice - both ways are not handy. Moreover, they are not easy to be realized in scripts. Finally, the cm_RereadSource command does not update the view either.
Is it possible to implement the cm_UpdateQuickViewWindow command or to add a new function to the cm_RereadSource?
Single user license #329241
PowerPro scripts for Total Commander
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

F2 should work when the cursor is on the quick view panel.
Author of Total Commander
https://www.ghisler.com
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

2ghisler(Author)
It doesn't. I've noticed this behaviour when using the following command:

Code: Select all

[em_RotateImageClockwise]
button=e:\Storage\Graphics\Icons\User\Decr.ico
cmd=e:\Graphics\Viewers\Irfan\i_view32.exe
param=%P%N /rotate_r /convert=%P%N
menu=Rotate Image Clockwise (Right)
It calls IrfanView to rotate clockwise an image file under cursor. You can test it.
Even if it works, one should press three keys: Tab, F2, Tab. I suggest to press one. Is it difficult to implement the requested command?
Single user license #329241
PowerPro scripts for Total Commander
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems that TC itself is "eating" the F2 key, which is used to refresh the current directory, sorry. I will check whether I can use it for Quick View too.
Author of Total Commander
https://www.ghisler.com
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

I've found a solution of my problem. First, I have already a command from this post. Further, I created the following button:

Code: Select all

TOTALCMD#BAR#DATA
em_RotateImageClockwise,304,304

e:\Storage\Graphics\Icons\Downloaded\Clockwise-Green.ico
Rotate Image Clockwise with Refresh

0
10336
That is, the button first executes the Irfan command to rotate an image clockwise, then switches Quick View (usually off), and immediately switches it back (on). Image view is therefore updated, and almost no Quick View window blinking appears! (for the counterclockwise rotation the pocedure is similar).

2ghisler(Author)
1) It is still desirable to implement the requested command cm_UpdateQuickViewWindow;
2) Do you plan to add the multiple commands support not only in buttons, but in user commands, too?
Single user license #329241
PowerPro scripts for Total Commander
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

2) Do you plan to add the multiple commands support not only in buttons, but in user commands, too?
You can use TCMC or TCFS2, both work fine:)
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

I've already done this with PowerPro scripts. I just would like this property to be realized by TC internally.
BTW, my above solution is not perfect: for the first time the Quick View panel is not updated, but it is for 2nd and subsequent command executions
Single user license #329241
PowerPro scripts for Total Commander
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

As I have requested, the new cm_UpdateQuickView is added in TC9.0. But for my purpose it still doesn't work. My script is (in PowerPro):

Code: Select all

args Obj, Dir
local hwnd = win.handle("c=TTOTAL_CMD")
local Irfan = "c:\Graphics\Viewers\Irfan\i_view64.exe"
local Option = " /jpg_rotate=(" ++ ifelse(Dir == "L", "5", "3") ++ ",0,0,0,0,0,0,0)"
local Str = Obj ++ Option ++ " /convert=" ++ Obj
file.runwait(0, Irfan, Str)
win.sendmessage(hwnd, 0x400+51, 2946, 0)
Script takes two parameters: first is %P%N and second is "L" (rotate counterclockwise) or "R" (clockwise). 2946 is a numeric code for the cm_UpdateQuickView command.
But after the script execution the quick view panel is not updated! Although the script works, that can be visualized by moving cursor up/down or down/up, or by loading the image into the separate IrfanView window and refreshing the view.
Moreover, if I rotate the image from the Irfan window, save the file, and then switch back to the TC window, I don't see any quick view update either.
Chaining command to execute script with 2946 (with or without executing #2946 from the script) gives the same effect: script works, image is rotated, but the quick view window is not updated.

So, what is the application field of the new cm_UpdateQuickView command? How is it supposed to use it?
Single user license #329241
PowerPro scripts for Total Commander
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, cm_UpdateQuickView works for me with some plugins I tried - I issued cm_UpdateQuickView from the command line after editing a file, and the lister plugin picked it up. What plugin are you trying to refresh? Maybe the plugin doesn't really support it?
Author of Total Commander
https://www.ghisler.com
Post Reply