Closed philmoz closed 7 years ago
how does it prevent it from running twice? Does startAsyncTask use single thread pool or something?
EDIT: running this code I can still reproduce the 'Task Completed' dialog that can't be closed. All I'm seeing from this is a check on isCanceled and then not showing the dialog. As I noted in the issue i filed about this, there's no way to interrupt the thread and cancel out immediately. But at least checking for canceled() is better than nothing.
It appears that doing the call to 'checkPhotoAvailability' outside the 'innerContext' was allowing you to trigger the plugin twice. I was only able to do this by mapping a keyboard shortcut to the plugin - sometimes the plugin would take a while to start and I would hit the shortcut again.
I noticed that the metadata dialog plugin didn't do this, and the main difference was the extra code being run before the 'innerContext'.
It appears that doing the call to 'checkPhotoAvailability' outside the 'innerContext' was allowing you to trigger the plugin twice.
gezzz......
turns out the dialog blocks all UI input which is what stops it from opening twice. Move the photo check to inside past the progress dialog opening is the trick needed.
thanks combined the code and merged in.
This change allows the progress dialog to be cancelled. It also prevents the plugin from being run twice which locks up LR with a 'Task Completed' dialog box that can't be closed.