Can't continue copying to WFX after pressing Esc
Moderators: Hacker, petermad, Stefan2, white
Can't continue copying to WFX after pressing Esc
Problem appears if user presses Escape but wants to continue operation and presses Cancel on abort message. In this case following loop occur:
1. plugin calls TcProgressProc to say that file copy started and it returns 1 (i.e. user wants to abort operation).
2. plugins asks user to abort but user says Cancel (he wants to continue operation).
3. plugin calls TcProgressProc to say that file copy finished and it returns 1 again.
4. plugin continues operation and doesn't return FS_FILE_USERABORT since operation is continued.
5. when plugin starts to copy next file situation repeats from step 1.
So if user presses Esc once, plugin will ask to abort operation during copying every single file (2 or more times!). Also this bug disables using Esc for breaking folder size calculation before copying since after pressing Esc user won't be able to complete operation normally (because of multiple abort questions).
It is expected that TcProgressProc will return 1 only once after user presses Esc and will return 0 then until user presses Esc again. I.e. TC should set cancel flag when user presses Esc but unset this flag when its TcProgressProc function returns 1 to plugin.
1. plugin calls TcProgressProc to say that file copy started and it returns 1 (i.e. user wants to abort operation).
2. plugins asks user to abort but user says Cancel (he wants to continue operation).
3. plugin calls TcProgressProc to say that file copy finished and it returns 1 again.
4. plugin continues operation and doesn't return FS_FILE_USERABORT since operation is continued.
5. when plugin starts to copy next file situation repeats from step 1.
So if user presses Esc once, plugin will ask to abort operation during copying every single file (2 or more times!). Also this bug disables using Esc for breaking folder size calculation before copying since after pressing Esc user won't be able to complete operation normally (because of multiple abort questions).
It is expected that TcProgressProc will return 1 only once after user presses Esc and will return 0 then until user presses Esc again. I.e. TC should set cancel flag when user presses Esc but unset this flag when its TcProgressProc function returns 1 to plugin.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I will check that, thanks for the detailed description!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I don't understand step 2 - the user has already clicked on "Abort" in the porgress dialog, and I don't get any further dialogs with the plugins I tried - the operation just ends. Can you name a plugin which shows such a second "continue" dialog, please?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
You may try my Virtual Panel. Just try to copy Windows folder into VP - you will have enough time to see the problem.
I think plugins abort operation w/o any questions - that's why you don't see any dialogs. Or maybe some plugin writers got same error and removed question dialogs.
But I want to ask user if he really wants to abort operation - and you may see what happens.
The main reason is that Escape allows to skip folder size calculation before copying - and I want to use it, but if I use it, TC treats it as abort - but I don't want to just ignore abort possibility like Temporary Panel plugin does.
I think plugins abort operation w/o any questions - that's why you don't see any dialogs. Or maybe some plugin writers got same error and removed question dialogs.
But I want to ask user if he really wants to abort operation - and you may see what happens.
The main reason is that Escape allows to skip folder size calculation before copying - and I want to use it, but if I use it, TC treats it as abort - but I don't want to just ignore abort possibility like Temporary Panel plugin does.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I see - currently that situation isn't planned. Once the user has clicked "Cancel", the plugin will get that warning until it aborts the transfer. This way it can e.g. finish the current file until it really stops.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Maybe TC will allow to reset abort state if ProgressProc is called with some special values? E.g. if percent value is -1 or 1000 and source/target both are zeroes? So if ProgressProc returns 1 to plugin but user wants to continue operation, plugin calls ProgressProc(PluginNr, 0, 0, 1000) - and TC clears abort flag? It won't affect existing plugins but will allow new plugins to ask user before aborting (currently this endless warning is the only bad reason why plugin can't ask user's confirmation).
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
That sounds indeed like a good idea. But the plugin would still have to abort the operation if TC then still signals abort. This would also ensure compatibility with older TC versions.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Plugin may detect WDX interface version to know if such function is supported. Currently my VirtualPanel ignores returned 1 from ProgressProc and cancels operation only if Escape is pressed (in this case I can ask user if he wants to abort and continue operation on user's choice). But according to WDX interface version (if TC will support such suggestion) I may use more user-friendly way to abort operations.ghisler(Author) wrote:That sounds indeed like a good idea. But the plugin would still have to abort the operation if TC then still signals abort. This would also ensure compatibility with older TC versions.