cooja
cooja copied to clipboard
Rework load progress dialog
This uses the Java builtin ProgressMonitor class. As an additional bonus, this makes the cancel button work.
@nfi after the latest changes, this should work better since the AWT thread isn't as contended as before.
Looks better. There are no longer any problems interacting with the progress dialog under macOS. Some things I noticed:
- If a simulation fails to load and I close the error message dialog - the progress dialog remains open and idle. And another progress dialog opens if I load the simulation again.
- If I cancel loading a simulation and reload the simulation, I often end up with multiple instances of the plugins. It seems the old simulation sometimes is not completely removed before the new simulation is set up. I am not sure if this issue is noticeable now due to the cancel button working better or something else, but I did not manage to reproduce this in the master. And it does not seem to happen if I wait a little before reloading the simulation, so I suspect a race condition somewhere.
The first issue is fixed, was missing a setProgress when restarting/cancelling.
The second issue is hard to reproduce, even when I limit my CPU to 1700 MHz. I fixed the issue I found.
The last revision worked, but I think the commit history had some rebase-leftovers. Fixed that, and everything should work in this revision.