From: pascale.noyret Date: Tue, 7 Feb 2017 15:48:08 +0000 (+0100) Subject: edition d un fichier pytel existant X-Git-Tag: Salome_8_3_Hydro_2_0rc1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c4a73acb27674224d6954d4423789c72e0ba02bc;p=modules%2Fhydrosolver.git edition d un fichier pytel existant --- diff --git a/src/salome_hydro/gui_utils.py b/src/salome_hydro/gui_utils.py index 7684fe6..0879e58 100644 --- a/src/salome_hydro/gui_utils.py +++ b/src/salome_hydro/gui_utils.py @@ -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): diff --git a/src/salome_hydro/pytel/gui.py b/src/salome_hydro/pytel/gui.py index a84dd74..91571a0 100755 --- a/src/salome_hydro/pytel/gui.py +++ b/src/salome_hydro/pytel/gui.py @@ -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(): """