Page 7 of 8

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-26, 10:23 UTC
by AntonyD
ghisler(Author) wrote: โ†‘2024-01-26, 10:06 UTC In RC3 I will keep the Lister window open half a second after launching the editor, this way it should be easier for third party tools to determine that they were not launched from the main TC window.
Why you don't think that next suggestion:
Flint wrote: โ†‘2024-01-25, 12:03 UTC
ghisler(Author) wrote: โ†‘2024-01-25, 08:36 UTC then TCER will have to be updated to detect whether the calling window is Total Commander or not.
Do you think you could introduce some difference; maybe pass an extra environment variable into the started editor's environment block, which would contain a value, defining the particular type of the editor call? Then the proxy-editor authors could easily recognize all the scenarios.

For example, a variable named %COMMANDER_EDITOR_SRC%, which would contain one of the possible values:
main, if the editor was called from the main TC panels;
sync, if it was called from SyncDirs;
find, if from Find Files;
lister, if from Lister;
cmd, if called via cm_Edit.
I think that would cover it.
isn't a MUCH more better variant? It will be easy to use NOT only for fully finished third-party programs,
but also for our own scripts, which may definitely not have enough time for analysis, if they can detect
this time-lag at all.
And thanks to such values, there is much more "space" for performing some necessary actions,
Previously, which could not even be fulfilled - because it was impossible to determine the initial conditions
of their triggering...

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-26, 10:40 UTC
by ghisler(Author)
The idea is that some tools may already work with F4 in sync because it was introduced in 2020, so they wouldn't need to be changed when they detect that the calling window wasn't main TC. Your suggestion means that all such tools would have to be changed.

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-26, 12:15 UTC
by Flint
They don't have to be changed. Environment variables can be simply ignored, which is why I suggested this approach in the TCER topic: it's a great way to provide information while keeping 100% backwards compatibility. So the old tools continue to work like they did before, and new and updated tools will be able to use this new information for reliable detection.

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-26, 13:56 UTC
by AntonyD
which is why I suggested this approach in the TCER topic.....
exactly! And the same - that' why I've mentioned you suggestion only inside this "similar" topic...
2ghisler(Author)
again - new var with new values - CAN BE used for a new and freshly-updatable programs.
But they don't HAVE TO do this... They can ignore this totally.

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-28, 07:55 UTC
by ghisler(Author)
Maybe it's best to do both?

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-28, 11:07 UTC
by AntonyD
and a new var\values AND a small time-lag? Yep, not a bad design, IMHO.

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-29, 11:34 UTC
by ghisler(Author)
This turned out more complex than expected, there are a lot of locations where a program can be launched.
Here is the list I will use. The variable will be named %COMMANDER_OPEN%

bar : Button bar button
changeini: Menu Configuration - Change ini files directly
cmd: Menu Commands - Open command prompt window
cmdline: Command line
contextmenu: Right click context menu
delete: Delete from archive (launching external packer)
edit: F4 in main program
editlistfile: Edit list file in background transfer manager
hotkey: User-defined hotkey
lister: F4 in Lister
menu: Menu "Start"
new: Context menu, submenu "New"
open: Enter or double click
pack: Pack with external packer
unpack: Unpack with external packer
view: View with internal viewer (default Alt+F3)
find: F4 in Commands - Search

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-29, 13:11 UTC
by Flint
Thanks a lot! This will definitely help!
Do I understand correctly that "hotkey" and "edit" are basically the same (starting an editor from the main TC window), only with different hotkeys?

Also, is it possible to distinguish the command cm_Edit started, for example, from buttonbar, but in one case it's without arguments (to open the currently chosen file in the TC panels), and in another case with parameters specifying the particular file to open?

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-29, 15:00 UTC
by petermad
2ghisler(Author)
Aren't you missing:
sync: F4, Shift+F4 or context menu in the Sync tool.
hotlist: Directory hotlist.
mrtlist: Edit names in the Multi-rename tool

Then I wonder about:
auto: Auto-run commands in View Modes
- here user commands (em_commands) can be used and they can open external programs.

view: View with internal viewer (default Alt+F3)
Shouldn't that be External viewer

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Posted: 2024-01-29, 15:33 UTC
by ghisler(Author)
Do I understand correctly that "hotkey" and "edit" are basically the same (starting an editor from the main TC window), only with different hotkeys?
No, hotkey is when the user defines an em_command and opens that with a user-defined hotkey (Configuration - Options - Misc).
Aren't you missing:
sync: I'm actually setting that, it just wasn't documented.
hotlist, mrtlist: These don't currently set the value. I will add them.
Please let me know if you find any others.
Shouldn't that be External viewer
Yes, you are right.

Re: F4 from Lister to Editor

Posted: 2024-01-29, 16:10 UTC
by AntonyD
2ghisler(Author)
I found a solution: You will be able to set a different editor for F4 invoked from Lister:
wincmd.ini
[Lister]
Editor=<your editor> "%1"
OK. I see it in history1103.txt.
BUT why it was not added inside the GUI form? Lister -> Configure ... -> tab General????
You ALREADY have a proper translatable string(-s): 5186 and\or 5187

Re: F4 from Lister to Editor

Posted: 2024-01-29, 16:29 UTC
by petermad
BUT why it was not added inside the GUI form? Lister -> Configure ... -> tab General
Maybe because there is no more space in that dialog? - but it would be the right place to put it.

Re: F4 from Lister to Editor

Posted: 2024-01-29, 17:31 UTC
by petermad
history.txt wrote:26.01.24 Added: F4 in Lister: If F4Edit is set to 2 or 3, keep Lister open for half a second after launching the editor, so a multi-editor launcher like F4menu can detect that it wasn't opened by the main program (32/64)
I can confirm that this works fine in TC 11.03rc3 with F4 configured for F4Menu and with multiple files selected.

Re: F4 from Lister to Editor

Posted: 2024-01-29, 20:03 UTC
by petermad

Moderator message from: petermad ยป 2024-01-29, 20:02 UTC


Re: F4 from Lister to Editor

Posted: 2024-01-29, 20:05 UTC
by petermad
2ghisler(Author)
These should be included::

auto: Auto-run commands in View Modes
- here user commands (em_commands) can be used and they can open external programs.

assoc: Internal Associations.



I testet this a little:
bar, cmd, cmdline, contextmenu, delete, edit, hotkey, menu, open, pack, view, find and sync all work as expected.

lister: does not seem to work - pressing F4 in Lister returns edit.
unpack: only works when pressing Alt+F9 not when pressing F5 inside an archive.
- pack works with both Alt+F5 and F5 with open archive in target panel, so unpack should also work with F5.
I have not been able to test: changeini, editlistfile and new.

em_commands works for hotkey and cmdline, but NOT for bar and menu - and should also work for auto and assoc if implemented.