MainWindow: Detect end of simulation

When simulation is finished, mainwindow is now updated.