From dea6353b9976479fdf3754dd5034352ae2fda617 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 18 Jun 2017 13:22:39 +0200 Subject: [PATCH] edit menus for Telemac2D case, option French or English --- src/HYDROGUI/HYDROSOLVERGUI.py | 32 ++++++++++++++++------ src/salome_hydro/telemac2d/eficas/appli.py | 6 ++-- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/HYDROGUI/HYDROSOLVERGUI.py b/src/HYDROGUI/HYDROSOLVERGUI.py index b799e17..389ed81 100755 --- a/src/HYDROGUI/HYDROSOLVERGUI.py +++ b/src/HYDROGUI/HYDROSOLVERGUI.py @@ -68,11 +68,12 @@ class GUIcontext: EDIT_PYTEL_CASE_ID = 953 GENERATE_JOB = 954 #DEFINE_BOUNDARY_CONDITIONS_ID = 955 - DEFINE_CAS_FILE = 955 + DEFINE_CAS_FILE_EN = 955 EDIT_BOUNDARY_CONDITIONS_FILE_ID = 956 GENERATE_INTERPOLZ_PY_ID = 957 GEN_TELEMAC2D_PYTHON_ID = 958 GEN_TELEMAC2D_YACS_ID = 959 + DEFINE_CAS_FILE_FR = 960 def __init__( self ): # create top-level menu @@ -132,9 +133,17 @@ class GUIcontext: sgPyQt.createTool( a, tid ) a = sgPyQt.createSeparator() - a = sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE, - "Edit cas file", "Edit cas file", - "Create/edit a .cas file for Telemac", + a = sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_EN, + "Edit cas file (English)", "Edit cas file (English)", + "Create/edit a .cas file for Telemac (English)", + "define_cas_file.png" ) + sgPyQt.createMenu( a, mid ) + sgPyQt.createTool( a, tid ) + + a = sgPyQt.createSeparator() + a = sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_FR, + "Edit cas file (French)", "Edit cas file (French)", + "Create/edit a .cas file for Telemac (French)", "define_cas_file.png" ) sgPyQt.createMenu( a, mid ) sgPyQt.createTool( a, tid ) @@ -171,8 +180,10 @@ class GUIcontext: sgPyQt.createAction( GUIcontext.GENERATE_JOB, "Generate batch job", "Generate batch job", "Generate a batch job to run the selected case") - sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE, "Edit .cas file", "Edit .cas file", + sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_EN, "Edit .cas file", "Edit .cas file", "Edit .cas file") + sgPyQt.createAction( GUIcontext.DEFINE_CAS_FILE_FR, "Edit .cas file (French)", "Edit .cas file (French)", + "Edit .cas file (French)") ################################################ @@ -508,8 +519,12 @@ def generate_interpolz_py(): ### # Open dialog for boundary conditions edition ### -def eficas_for_cas_Telemac2D(): - runEficas(code='TELEMAC') +def eficas_for_cas_Telemac2D_fr(): + EficasForTelemac2DAppli(code='TELEMAC', lang = 'fr') + +def eficas_for_cas_Telemac2D_en(): + EficasForTelemac2DAppli(code='TELEMAC', lang = 'en') + ### # Commands dictionary ### @@ -533,5 +548,6 @@ dict_command = { #GUIcontext.DEFINE_BOUNDARY_CONDITIONS_ID: define_boundary_conditions, GUIcontext.EDIT_BOUNDARY_CONDITIONS_FILE_ID: edit_boundary_conditions_file, GUIcontext.GENERATE_INTERPOLZ_PY_ID: generate_interpolz_py, - GUIcontext.DEFINE_CAS_FILE: eficas_for_cas_Telemac2D, + GUIcontext.DEFINE_CAS_FILE_EN: eficas_for_cas_Telemac2D_en, + GUIcontext.DEFINE_CAS_FILE_FR: eficas_for_cas_Telemac2D_fr, } diff --git a/src/salome_hydro/telemac2d/eficas/appli.py b/src/salome_hydro/telemac2d/eficas/appli.py index a7a69a5..156ab62 100644 --- a/src/salome_hydro/telemac2d/eficas/appli.py +++ b/src/salome_hydro/telemac2d/eficas/appli.py @@ -47,13 +47,13 @@ class EficasForTelemac2DAppli(eficasSalome.MyEficas): :param fichier: path of an Eficas file to open """ - def __init__(self, fichier = None, version = None): + def __init__(self, code = "telemac2d", fichier = None, version = None, lang = None): self.ed = HydroStudyEditor() self.codedir = os.path.dirname(__file__) sys.path[:0] = [self.codedir] eficasSalome.MyEficas.__init__(self, sgPyQt.getDesktop(), - "telemac2d", - fichier, version = version) + code = code, fichier = fichier, + version = version, lang = lang) area = QScrollArea(SalomePyQt.SalomePyQt().getDesktop()); gridLayout = QGridLayout(area) gridLayout.addWidget(self) -- 2.39.2