1) The example "Database_Diagnose" shows how not to do this. It uses
while mThreadFinished = false
2) The menu is in MainWindow, which sends the diagnosis to the MainWindowController, then to MaxModel. We go to the DBUtilities class which does the DiagnosisThread. And this is without mentioning the progress window.
I changed the above code to a notification which goes do the DBUtilities class. However, I can't stop the interface in MainWindow from doing something. Since it's become en vogue not do do crash reports anymore my app just does vanish.
Not even events would help here because I can't block anything.
So what can I do?
1. I could close the database, do the diagnosis and open the database again. Ugly. Likely will change the selection.
2. I could try to set the open cursors to nil, do the diagnosis and reset the cursors. Not sure what would happen in the interface.
3. I could try to find out where the app crashes and fix that. Without crash log this is suboptimal. Not sure what would happen in the interface and if there are other places where the app could crash.
No solution sounds really good.
Am I overthinking this? Is there a simpler solution?
Xojo 2018r4, Valentina 8.7.
I still don't understand why you can't do like Christian or other database plugins MT (multithread) versions of the normal methods which encapsulate the whole multithreading operations so that we don't have to do this complicated stuff. And I haven't even looked at the diagnosis I do at the end of archiving which has a way more complex set of events.
Mit freundlichen Grüßen/Regards
Mail Archiver X: The email archiving solution for professionals