How to handle the Find with "Find Text" in FS Plgu

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

Moderators: Hacker, petermad, Stefan2, white

djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

How to handle the Find with "Find Text" in FS Plgu

Post by *djorge »

The find function (Alt-F7) has a checkbox "Find text". I know it is possible to handle this feature in FS plugins. CDDatabase does it very well, but i can't find information this anywhere in the forum.

Does anyone know how to handle this?

Another Question:
Is it possible to use the custom columns defined in a FS plugin in the FIND window of TC through the plugin TAB or is this tab only for content plugins?
______________________
David Jorge
Personal License #117854
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

AFAIK, FS plugin API doesn't provide ability to handle search operations in general, nor ability to handle any settings from "Search" dialog called on Alt+F7.
What do you mean "CDDatabase does it very well"? What exactly it does?
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

TC lets you search for files in FS plugins via the FNC cycle.

In CDDatabase, you can search for text written in the comments field if you set the "Find text" checkbox. There must be a way to detect this option.
______________________
David Jorge
Personal License #117854
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

There must be a way to detect this option.
Ok, let's be more accurate. :) FS plugin API doesn't provide such abilities. But you can get similar result if you implement some heuristic logic. Of course this logic may be inadequate in future TC versions.

My guess - CDDatabase works under the following assumption: if TC requests file content during file enumeration phase it means there search in progress and CDDatabawse returns as result not original file, but special text file called <original filename>.comment. This trick allows for TC to check search criteria.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The right way to detect whether a text search is going on is to implement the FsStatusInfo function in the plugin, and look for the value
FS_STATUS_OP_SEARCH_TEXT
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

2ghisler(Author)
Is it possible to handle text search inside of plugin without creating fake files?

BTW, FsStatusInfo is not always called by TC.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Is it possible to handle text search inside of plugin without creating fake files?
No, that's not supported.
BTW, FsStatusInfo is not always called by TC.
It should - can you give me an example when it isn't called, please?
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

It should - can you give me an example when it isn't called, please?
I guess you mean example for TC7, not for older version?

Example 1: (frequent)
1. For some reason error message appears "...Do you want to continue execution? YES/NO"
2. user press YES button - the next FsStatusInfo call is missing.

Example 2: (rarely)
1. user switch TC to show temp panel with custom view containing fields from several content plugins.
2. TC starts to fill in background thread custom fields in this view and at this moment user press Ctrl+R - the next FsStatusInfo call is missing.


There also exists issue not related to file enumeration. You wrote in Help file:
All calls to plugin functions will be enclosed in a pair of FsStatusInfo() calls: At the start, FsStatusInfo(...,FS_STATUS_START,...) and when the operation is done FsStatusInfo(...,FS_STATUS_END,...).
But all newly added functions FsContentxxx aren't enclosed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will check that, thanks. Please note that FsStatusInfo is only called for foreground thread operations. Background thread calls are NOT enclosed. The FsContentxxx calls aren't enclosed either because they are treated like content plugin calls, not file system plugins. I will put a note in the help.
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

Please note that FsStatusInfo is only called for foreground thread operations. Background thread calls are NOT enclosed.
Oh, I didn't knew this. Thanks! It is worth to mention this in help file too.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Example 1: (frequent)
1. For some reason error message appears "...Do you want to continue execution? YES/NO"
2. user press YES button - the next FsStatusInfo call is missing.
Can you tell me the exact words of the error message, please? I need it because I cannot find any location in my code where the second FsStatusInfo is not called. If you only know the Russian text, please search it in wcmd_rus.lng and tell me the string number. Thanks!
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

I mean the following message.
---------------------------
Total Commander
---------------------------
External exception E06D7363.
Please report this error to the Author,
with a description of what you were doing when this error occured!
Continue execution?
---------------------------
Yes No
---------------------------
I dont have any *.lng file so I don't know what is the string number.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

That's not really an error message, it's a crash in some plugin or external dll! What you see is the 'catch all' exception handler in Total Commander. When we get to this point, all operations are completely stopped, including calls to plugins.

Can you tell me what you were doing when you received this access violation? I'm trying to catch such access violations individually for plugin calls and warn the user in which plugin it occurred. Apparently I didn't catch this specific call...
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

ghisler(Author) wrote:When we get to this point, all operations are completely stopped, including calls to plugins.
It is exactly what I supposed.
Can you tell me what you were doing when you received this access violation?
Of course I cannot! What do you think - I have some specific scenario causing exception in TC and I didn't reported about it?! :shock:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

That's not what I meant - I would like to know what function you were using in TC when you received the access violation, e.g. just browsing directories, uploading to the plugin or downloading from it, etc.
Author of Total Commander
https://www.ghisler.com
Post Reply