]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
edition d un fichier pytel existant
authorpascale.noyret <pascale.noyret@edf.fr>
Tue, 7 Feb 2017 15:48:08 +0000 (16:48 +0100)
committerpascale.noyret <pascale.noyret@edf.fr>
Tue, 7 Feb 2017 15:48:08 +0000 (16:48 +0100)
src/salome_hydro/gui_utils.py
src/salome_hydro/pytel/gui.py

index 7684fe68dec6e230625b27b135a6e534ef478279..0879e58249f8fbc5a3430fc6fbce9d33bb8ba7da 100644 (file)
@@ -59,6 +59,7 @@ def get_and_check_selected_file_path():
   attribute contains a valid file path, and return this file path.
   """
   ed = getStudyEditor()
+  if len(salome.sg.getSelected()) == 0 : return None
   sobj = ed.study.FindObjectID(salome.sg.getSelected(0))
   filepath = sobj.GetComment()
   if not os.path.isfile(filepath):
index a84dd7460c6ca0efb1b449e747eb6d123fe4e2c2..91571a0d39c3e514d4b4f0470f903bd0d8ba962a 100755 (executable)
@@ -25,12 +25,16 @@ from salome.hydro.pytel.eficas.appli import EficasForPytelAppli
 from launcher import run_pytel
 from genjobwindow import GenJobDialog
 
+from PyQt5.QtWidgets import  QFileDialog
 
 def create_case_pytel():
   EficasForPytelAppli()
 
 def edit_selected_case_pytel():
-  EficasForPytelAppli(get_and_check_selected_file_path())
+  file=get_and_check_selected_file_path()
+  if file == None :
+     file, filt = QFileDialog.getOpenFileName(self, self.tr("Open Pytel file"), "", )
+  EficasForPytelAppli(fichier=file)
 
 def get_params_from_selected_case():
   """