Notification when both panes are equal

English support forum

Moderators: white, Hacker, petermad, Stefan2

zorg
Junior Member
Junior Member
Posts: 13
Joined: 2017-07-14, 03:05 UTC

Notification when both panes are equal

Post by *zorg »

Hello -

I'd like to get notification when both panes are pointing to the same directory.

My first though was: a special background colour when that situation is encountered. EG, turn the background colour yellow when both panes are at the same directory.

Another approach might be a warn-on-delete-attempt when the path for both panes is the same, though that wouldn't capture some situations (eg user thinks panes are pointing to different dirs, and opens a file for editing, thinking the 'other' file will be unmodified).

The reason is: I recently deleted a file by mistake; I was moving many files around to a new location, and at one point, I deleted a file, not realizing my 'source' directory and 'destination' directory were the same. I had thought I was only deleting the file from the source. It wasn't a big problem, but I'd like to avoid it in the future.

I saw here[1] that it's possible to link colour schemes with usercommands. Is there a mechanism to add conditional checks? The logic is fairly straightforward, something like:

When path of a pane changes, if pane1.path==pane2.path, set colourmode=warn, else set colourmode=normal

Thanks!

[1] https://www.ghisler.ch/board/viewtopic.php?t=18448
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Notification when both panes are equal

Post by *Stefan2 »

zorg wrote: 2023-03-13, 20:38 UTC Is there a mechanism to add conditional checks? The logic is fairly straightforward, something like:

When path of a pane changes, if pane1.path==pane2.path, set colourmode=warn, else set colourmode=normal

No that is not possible, but if you use AutoHotkey, that will be possible by having running a script in the background.

The normal way is to have the "[y] Show current directory" enabled
in "Configuration > Options... > Layout" and take care of that both paths shown above of the list.







 
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Notification when both panes are equal

Post by *Fla$her »

zorg wrote: 2023-03-13, 20:38 UTCturn the background colour yellow when both panes are at the same directory.
A good idea for the corresponding subforum. But there is one problem: the equivalent directory in one panel can be normal, and in another — virtual.
zorg wrote: 2023-03-13, 20:38 UTCAnother approach might be a warn-on-delete-attempt when the path for both panes is the same
There's the same problem. Although if you don't bother with virtual folders, then do this:
1. Save the code to QDelete.vbs:

Code: Select all

If WSH.Arguments(0) = WSH.Arguments(1) Then _
If MsgBox("Source = target!" & vbLf & "Continue?", 262180, "Total Commander") <> 6 Then WSH.Quit
CreateObject("WScript.Shell").Exec "%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef tcm(908)"
1a. Check in it the path to TCFS2.exe.
2. Create an em_Delete? with the path to the script. For example: %COMMANDER_PATH%\Scripts\QDelete.vbs
2a. Specify the parameters: "%P" "%T"
3. Bind this command to the hotkeys: Del, Shift+Del, F8, Shift+F8.
Overquoting is evil! 👎
zorg
Junior Member
Junior Member
Posts: 13
Joined: 2017-07-14, 03:05 UTC

Re: Notification when both panes are equal

Post by *zorg »

I've always had the path showing, but I'd still like to add a warning, if possible, in case I forget to check in the future.

Both of those methods sound like they could work, at least to capture a delete attempt. I'll add a request to the suggestions forum.

Unfortunately, both links to TCFS2 appear to be expired (wincmd.ru & totalcmd.net).

I'll take a look at AutoHotKey. I can see how to trigger it on a delete attempt, but not on a path change. Is there a straightforward way to do that?
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Notification when both panes are equal

Post by *Fla$her »

zorg wrote: 2023-03-15, 04:07 UTCUnfortunately, both links to TCFS2 appear to be expired (wincmd.ru & totalcmd.net).
No, this is a long-term pathological problem of the chosen hosting. It will work later. And the link in my post is working now.
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Notification when both panes are equal

Post by *beb »

Fla$her wrote: 2023-03-15, 04:51 UTC
zorg wrote: 2023-03-15, 04:07 UTCUnfortunately, both links to TCFS2 appear to be expired (wincmd.ru & totalcmd.net).
No, this is a long-term pathological problem of the chosen hosting. It will work later. And the link in my post is working now.
Btw, there's a backup source:
http://ru.wincmd.com/tcbak/ [to type names here]
http://ru.wincmd.com/tcbak/?s=TCFS2 [TCFS2 is typed]
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Notification when both panes are equal

Post by *Fla$her »

2beb
Cool. And where did such a miracle come from? :o
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Notification when both panes are equal

Post by *beb »

2Fla$her: somewhere on the web (translated by me):
On the issues with wincmd.ru/totalcmd.net:
On the seventh day of almost every month (sometimes adjusted for weekends) the hosting is not paid for and the server automatically shuts down. In this case, you just have to wait for Ergo (the site owner) to make the payment, which usually happens within one or two days. A backup copy of the plugin database is available at http://ru.wincmd.com/tcbak/.
And if you typed just https://wincmd.com you would be redirected somewhere. So my vote goes for some aliens :)
The address has been known for about four months, I don't know why it doesn't gain wide publicity. Maybe there are some reasons.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Notification when both panes are equal

Post by *Fla$her »

2beb
Yeah, thanks. I found a December message from Maz.
The link is useful, it should be fixed here and at the bottom of the page.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Notification when both panes are equal

Post by *petermad »

Regarding plugins and tools -also older versions - you are always welcome to ckeck my personal online backup at:
http://tcmd.madsenworld.dk/plugins
http://tcmd.madsenworld.dk/tools
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Notification when both panes are equal

Post by *Fla$her »

2petermad
Thanks. It is worth updating TCFS2Tools by the second link.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Notification when both panes are equal

Post by *petermad »

Fla$her wrote: 2023-03-15, 16:42 UTC 2petermad
Thanks. It is worth updating TCFS2Tools by the second link.
Hmm, if I follow the links at viewtopic.php?t=29700 I get the same versions you see in my https://tcmd.madsenworld.dk/tools/ folder - are there newer versions?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Notification when both panes are equal

Post by *Fla$her »

petermad wrote: 2023-03-16, 04:35 UTCare there newer versions?
>>>
Fla$her wrote: 2023-02-23, 11:30 UTCP. S.: It's high time to post TCFS2Tools 1.4.4.220 and update the link on the sites.
Fla$her wrote: 2023-03-14, 11:26 UTCDownload here: TCFS2 and TCFS2Tools.
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 430
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Notification when both panes are equal

Post by *beb »

petermad wrote: 2023-03-16, 04:35 UTC ... versions you see in my https://tcmd.madsenworld.dk/tools/ folder - are there newer versions?
Which is the best place/way to inform you if a user sees plugins/tools of newer versions than you have on your site?
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Notification when both panes are equal

Post by *petermad »

Which is the best place/way to inform you if a user sees plugins/tools of newer versions than you have on your site?
Write me an email via the forum. But I do not promise to always keep those folders up-to-date - it is just my personal stash of old and current plugins and tools.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply