cooja icon indicating copy to clipboard operation
cooja copied to clipboard

Rework load progress dialog

Open pjonsson opened this issue 2 years ago • 4 comments

This uses the Java builtin ProgressMonitor class. As an additional bonus, this makes the cancel button work.

pjonsson avatar Dec 02 '22 15:12 pjonsson

@nfi after the latest changes, this should work better since the AWT thread isn't as contended as before.

pjonsson avatar Jan 13 '23 19:01 pjonsson

Looks better. There are no longer any problems interacting with the progress dialog under macOS. Some things I noticed:

  1. 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.
  2. 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.

nfi avatar Jan 14 '23 00:01 nfi

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.

pjonsson avatar Jan 14 '23 01:01 pjonsson

The last revision worked, but I think the commit history had some rebase-leftovers. Fixed that, and everything should work in this revision.

pjonsson avatar Jan 23 '23 20:01 pjonsson