From c4a73acb27674224d6954d4423789c72e0ba02bc Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Tue, 7 Feb 2017 16:48:08 +0100 Subject: [PATCH] edition d un fichier pytel existant --- src/salome_hydro/gui_utils.py | 1 + src/salome_hydro/pytel/gui.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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(): """ -- 2.39.2