Salome HOME
Numéro du cas
[modules/smesh.git] / src / Tools / YamsPlug / monViewText.py
index fe3e665d8f786d054223f62060fdf378ae7b2973..eb371b0f10a5d445e0f6d4b1b1f0f5b9a4cac54a 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2007-2019  EDF R&D
+# Copyright (C) 2007-2021  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -80,7 +80,7 @@ class MonViewText(Ui_ViewExe, QDialog):
 
     def saveFile(self):
         #recuperation du nom du fichier
-        savedir=os.environ['HOME']
+        savedir=os.path.expanduser("~")
         fn, mask = QFileDialog.getSaveFileName(None,"Save File",savedir)
         if not fn: return
         ulfile = os.path.abspath(str(fn))
@@ -109,8 +109,14 @@ class MonViewText(Ui_ViewExe, QDialog):
         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.')
+            if os.path.exists(self.parent().fichierOut):
+                self.parent().enregistreResultat()
+                QMessageBox.critical(self, 'Computation ended in error',
+                  'A new mesh has been generated but with some errors.'+
+                  '<br>Please, check the log message.')
+            else:
+                QMessageBox.critical(self, 'Computation failed',
+                  'The computation has failed.<br>Please, check the log message.')
         pass
 
     def errorOccured(self):