I’ve searched the forum but the only thing I found is “don’t use runModalLoop in plugins”.
But may be people can share their best practices for splash screens/confirmation dialogs implementation?
For example, if you got a few file names in a collection, and want to ask user if he still needs these, and I have to do it file-by-file, what would you do?
With modal dialog it’s pretty straightforward - just cycle through the collection and bring a dialog like “do you need a file ABC? yes/no”, wait for a user response and go to next file.
With callbacks it looks like I have to make a function that cycles through the collection, opens the confirmation dialog for an item N and then passes all the info (file name, the file index (N) in a collection etc) to the confirmation dialog, and then finally leaves that function.
The dialog should pass all this info to the callback.
Then in the dialog callback (upon user response) I have to check if the collection is still alive (as it’s asynchronous now), was it changed maybe etc etc, then delete the file from collection and then pass the index back to the initial function that cycles through the collection so that it could proceed with next item…
Looks kinda complex.
Am I overlooking some simple and obvious solution?