- if "END_OF_MGCleaner" in aa:
- self.parent().enregistreResultat()
- self.enregistreResultatsDone=True
- #self.theClose()
-
+
+ def finished(self):
+ self.PB_Ok.setEnabled(True)
+ self.PB_Cancel.setEnabled(False)
+ exit_code = self.monExe.exitCode()
+ if exit_code == 0 and not self.anErrorOccured:
+ self.parent().enregistreResultat()
+ elif not self.hasBeenCanceled:
+ QMessageBox.critical(self, 'Computation failed',
+ 'The computation has failed.<br>Please, check the log message.')
+ pass
+
+ def errorOccured(self):
+ # for instance if the executable is not found
+ self.anErrorOccured = True
+ self.finished()
+
+ def cancelComputation(self):
+ self.hasBeenCanceled = True
+ self.monExe.kill()
+