Salome HOME
synchronisation avec Yoann
[tools/eficas.git] / InterfaceQT4 / qtEficas.py
old mode 100644 (file)
new mode 100755 (executable)
index 95828f1..ced7931
 # -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2013   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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from __future__ import absolute_import
+from __future__ import print_function
+try :
+   from builtins import str
+except : pass
 
 import os, sys
+import six
 
-from PyQt4.QtGui  import *
-from PyQt4.QtCore import *
-from PyQt4.QtAssistant import *
-from myMain import Ui_Eficas
-from viewManager import MyTabview
 
+from PyQt5.QtWidgets import QApplication, QMainWindow, QBoxLayout, QMenu, QAction, QMessageBox
+from PyQt5.QtGui import QIcon
+from PyQt5.QtCore import Qt
+
+from Extensions.i18n import tr
+from Extensions.eficas_exception import EficasException
+from Extensions import param2
+
+
+from myMain import Ui_Eficas
+from .viewManager import MyTabview
+from .getVersion import getEficasVersion
 from Editeur import session
 
 
-class Appli(Ui_Eficas,QMainWindow):    
+
+class Appli(Ui_Eficas,QMainWindow):
     """
     Class implementing the main user interface.
     """
-    def __init__(self,code=None,salome=0,parent=None,ssCode=None,multi=False):
+    def __init__(self,code=None,salome=0,parent=None,ssCode=None,multi=False,langue='ang',ssIhm=False):
         """
         Constructor
         """
         QMainWindow.__init__(self,parent)
         Ui_Eficas.__init__(self)
-        self.setupUi(self)
 
-        self.VERSION_EFICAS="Eficas QT4 V6.4"
+
+        version=getEficasVersion()
+        self.VERSION_EFICAS="Eficas QT5 Salome " + version
         self.salome=salome
+        self.parentMainWindow=parent
         self.ihm="QT"
-       self.top = self    #(pour CONFIGURATION)
+        self.ssIhm=ssIhm
+        self.top = self    #(pour CONFIGURATION)
         self.QWParent=None #(Pour lancement sans IHM)
+        self.code=code
         self.indice=0
+        self.first=1
         self.dict_reels={}
+        self.recent =  []
+        self.ficRecents={}
+        self.mesScripts={}
+        self.listeAEnlever=[]
+        self.ListePathCode=['Adao','ADAO','Carmel3D','Telemac','CF','MAP','ZCracks', 'SEP','SPECA','PSEN_Eficas','PSEN_N1']
+        self.listeCode=['Adao','ADAO','Carmel3D','Telemac','CF','MAP','ZCracks', 'SEP','SPECA','PSEN_Eficas','PSEN_N1']
+        self.repIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'..','Editeur','icons')
+
+        if langue=='fr': self.langue=langue
+        else           : self.langue="ang"
+
+        if self.salome:
+          import Accas
+          import eficasSalome
+          Accas.SalomeEntry = eficasSalome.SalomeEntry
 
         self.multi=multi
-        if self.multi == False :self.definitCode(code,ssCode)
-        self.RepIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'../Editeur/icons')
-        eficas_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-        self.ajoutIcones()
+        self.demande=multi # specifique PSEN
 
 
-        self.viewmanager = MyTabview(self) 
-        self.recentMenu=self.menuFichier.addMenu(self.trUtf8('&Recents'))
-        self.connecterSignaux() 
+        if self.multi == False :
+             self.definitCode(code,ssCode)
+             if code==None: return
+
+
+      
+        if not self.salome and hasattr (self, 'CONFIGURATION') and hasattr(self.CONFIGURATION,'lang') : langue=self.CONFIGURATION.lang
+
+
+        self.suiteTelemac=False 
+        if hasattr (self, 'CONFIGURATION') :
+           if self.CONFIGURATION.force_langue :
+              from .monChoixLangue import MonChoixLangue
+              widgetLangue = MonChoixLangue(self)
+              ret=widgetLangue.exec_()
+           self.suiteTelemac=self.CONFIGURATION.suiteTelemac 
+           
+
+        from Extensions import localisation
+        app=QApplication
+        if hasattr (self, 'CONFIGURATION') : localisation.localise(None,self.langue,translatorFichier=self.CONFIGURATION.translatorFichier)
+
 
-        self.recent =  QStringList()
-        self.ficPatrons={}
-        self.initRecents()
 
-        self.ouvreFichiers()
+        self.setupUi(self)
+        #if parent != None : self.parentCentralWidget = parent.centralWidget()
+        #else              : self.parentCentralWidget = None 
+
+        if not self.salome :
+           if  hasattr (self, 'CONFIGURATION') and hasattr(self.CONFIGURATION,'taille') : self.taille=self.CONFIGURATION.taille
+           else : self.taille=1700
+
+           if self.code in ['MAP',] : self.resize(1440,self.height())
+           else : self.resize(self.taille,self.height())
+
+   
+        icon = QIcon(self.repIcon+"/parametres.png")
+        self.actionParametres.setIcon(icon)
+
+
+        self.myQtab.removeTab(0)
+        self.blEntete= QBoxLayout(0,self.frameEntete)
+        self.blEntete.insertWidget(0,self.toolBar)
+        self.blEntete.insertWidget(0,self.menubar)
+
+        if hasattr (self, 'CONFIGURATION') and self.CONFIGURATION.closeEntete==True and self.salome: self.closeEntete()
+
+        eficas_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+        #self.resize(20,20)
+        self.viewmanager = MyTabview(self)
+        self.recentMenu=QMenu(tr('&Recents'))
+        #self.menuFichier.insertMenu(self.actionOuvrir,self.recentMenu)
+        # actionARemplacer ne sert que pour l insert Menu
+        self.menuFichier.insertMenu(self.actionARemplacer ,self.recentMenu)
+        self.menuFichier.removeAction(self.actionARemplacer)
+        self.connecterSignaux()
+        self.toolBar.addSeparator()
+        if self.code != None : self.construitMenu()
+
         self.setWindowTitle(self.VERSION_EFICAS)
-        
+        #try :
+        if 1 :
+          self.ouvreFichiers()
+        #except EficasException, exc:
+        #except:
+        #  print "je suis dans le except"
+          #if self.salome == 0 : exit()
+
+        #self.adjustSize()
+
+    def closeEntete(self):
+        self.menuBar().close()
+        self.toolBar.close()
+        self.frameEntete.close()
+
     def definitCode(self,code,ssCode) :
         self.code=code
         self.ssCode=ssCode
-        self.cleanPath()
         if self.code==None :
-           from monChoixCode import MonChoixCode
+           self.cleanPath()
+           from .monChoixCode import MonChoixCode
            widgetChoix = MonChoixCode(self)
            ret=widgetChoix.exec_()
         import sys
+        if self.code == None:return # pour le cancel de la fenetre choix code
         name='prefs_'+self.code
         prefsCode=__import__(name)
 
         self.repIni=prefsCode.repIni
-        self.INSTALLDIR=prefsCode.INSTALLDIR
         if ssCode != None :
-           self.format_fichier= ssCode #par defaut
+           self.format_fichier= ssCode  #par defaut
            prefsCode.NAME_SCHEME=ssCode
         else :
-           self.format_fichier="python"        #par defaut
+           self.format_fichier="python" #par defaut
 
         nameConf='configuration_'+self.code
         configuration=__import__(nameConf)
@@ -75,151 +190,438 @@ class Appli(Ui_Eficas,QMainWindow):
         self.CONFIGStyle = None
         if hasattr(configuration,'make_config_style'):
            self.CONFIGStyle = configuration.make_config_style(self,prefsCode.repIni)
-        if hasattr(prefsCode,'encoding'):
-           import sys
-           reload(sys)
-           sys.setdefaultencoding(prefsCode.encoding)
-        if self.code in Appli.__dict__.keys():
-          listeTexte=apply(Appli.__dict__[self.code],(self,))
+        from Extensions import localisation
+        app=QApplication
+        if hasattr (self, 'CONFIGURATION') : localisation.localise(None,self.langue,translatorFichier=self.CONFIGURATION.translatorFichier)
+        #PN --> pb d exception qui font planter salome
+        # plus supporte en python 3
+        #if hasattr(prefsCode,'encoding'):
+        #   import sys
+        #   reload(sys)
+        #   sys.setdefaultencoding(prefsCode.encoding)
+
+    def construitMenu(self):
         self.initPatrons()
-        self.ficRecents={}
+        self.initRecents()
+        self.initAides()
+        for intituleMenu in ("menuTraduction","menuOptions","menuMesh","menuExecution","menuN1"):
+              if hasattr(self,intituleMenu):
+                 menu=getattr(self,intituleMenu)
+                 menu.setAttribute(Qt.WA_DeleteOnClose)
+                 menu.close()
+                 delattr(self,intituleMenu)
+        for intituleAction in ("actionExecution","actionSaveRun"):
+            if hasattr(self,intituleAction):
+              action=getattr(self,intituleAction)
+              self.toolBar.removeAction(action)
+        if self.code.upper() in Appli.__dict__:
+          Appli.__dict__[self.code.upper()](self,)
+        if self.suiteTelemac : self.lookSuiteTelemac()
+
+    def initAides(self):
+        #print "je passe la"
+        repAide=os.path.dirname(os.path.abspath(__file__))
+        fileName='index.html'
+        self.docPath=repAide+"/../Aide"
+        if hasattr(self,'CONFIGURATION') and hasattr(self.CONFIGURATION,'docPath') : self.docPath=self.CONFIGURATION.docPath
+        if hasattr(self,'CONFIGURATION') and hasattr(self.CONFIGURATION,'fileName'):fileName=self.CONFIGURATION.fileName
+        self.fileDoc=os.path.join(self.docPath,fileName)
+        self.actionCode.setText(tr("Aide specifique ")+str(self.code))
+        if not os.path.isfile(self.fileDoc) :
+               self.fileDoc=""
+               self.docPath=""
+               self.actionCode.setEnabled(False)
+               return
+
+        self.actionCode.setEnabled(True)
+        self.menuAide.addAction(self.actionCode)
+
+    def newN1(self):
+        ssCode=None
+        code="PSEN_N1"
+        self.cleanPath()
+        dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',"ProcessOutputs_Eficas"))
+        sys.path.insert(0,dirCode)
+        self.code=code
+        self.definitCode(code,ssCode)
+        self.initRecents()
+        self.multi=True
+        self.demande=False
+        self.fileNew()
+
+    def newPSEN(self):
+        ssCode=None
+        code="PSEN"
+        self.cleanPath()
+        dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',code))
+        sys.path.insert(0,dirCode)
+        self.code=code
+        self.definitCode(code,ssCode)
+        self.multi=True
+        self.demande=False
+        self.fileNew()
+
+    def ajoutN1(self):
+        self.menuN1 = self.menubar.addMenu(tr("Process Output"))
+        self.actionN1 = QAction(self)
+        self.actionN1.setText(tr("Process Output"))
+        self.menuN1.addAction(self.actionN1)
+        self.actionN1.triggered.connect(self.newN1)
+
+
+        if hasattr(self,'actionOpenProcess'):return
+        
+        self.actionOpenProcess = QAction(self)
+        self.actionOpenProcess.setText(tr("Open Process_Output File"))
+        self.menuN1.addAction(self.actionOpenProcess)
+        self.actionOpenProcess.triggered.connect(self.openProcess)
+
+    def ajoutExecution(self):
+        self.menuExecution = self.menubar.addMenu(tr("&Run"))
+        self.actionExecution = QAction(self)
+        if sys.platform[0:5]=="linux":
+          icon6 = QIcon(self.repIcon+"/roue.png")
+          self.actionExecution.setIcon(icon6)
+        else :
+          self.actionExecution.setText(tr("Run"))
+        self.actionExecution.setObjectName("actionExecution")
+        self.menuExecution.addAction(self.actionExecution)
+        if not(self.actionExecution in self.toolBar.actions()):
+           self.toolBar.addAction(self.actionExecution)
+        self.actionExecution.setText(tr("Run"))
+        self.actionExecution.triggered.connect(self.run)
+
+    def ajoutSauveExecution(self):
+        self.actionSaveRun = QAction(self)
+        icon7 = QIcon(self.repIcon+"/export_MAP.png")
+        self.actionSaveRun.setIcon(icon7)
+        self.actionSaveRun.setObjectName("actionSaveRun")
+        self.menuExecution.addAction(self.actionSaveRun)
+        if not(self.actionSaveRun in self.toolBar.actions()):
+           self.toolBar.addAction(self.actionSaveRun)
+        self.actionSaveRun.setText(tr("Save Run"))
+        self.actionSaveRun.triggered.connect(self.saveRun)
+
+    def griserActionsStructures(self):
+        self.actionCouper.setEnabled(False)
+        self.actionColler.setEnabled(False)
+        self.actionCopier.setEnabled(False)
+        self.actionSupprimer.setEnabled(False)
+
+    def enleverActionsStructures(self):
+        self.toolBar.removeAction(self.actionCopier)
+        self.toolBar.removeAction(self.actionColler)
+        self.toolBar.removeAction(self.actionCouper)
+        self.menuEdition.removeAction(self.actionCouper)
+        self.menuEdition.removeAction(self.actionCopier)
+        self.menuEdition.removeAction(self.actionColler)
+
+
+    def enleverParametres(self):
+        self.toolBar.removeAction(self.actionParametres)
+        self.menuJdC.removeAction(self.actionParametres)
+
+    def enleverSupprimer(self):
+        self.toolBar.removeAction(self.actionSupprimer)
+
+    def enleverNewInclude(self):
+        self.actionNouvel_Include.setVisible(False)
+
+    def enleverRechercherDsCatalogue(self):
+        self.actionRechercherDsCatalogue.setVisible(False)
+
+    def connectRechercherDsCatalogue(self):
+        if hasattr(self,'rechercherDejaLa') : return
+        self.rechercherDejaLa=True
+        self.actionRechercherDsCatalogue.triggered.connect(self.handleRechercherDsCatalogue)
+
+    def ajoutSortieLegere(self):
+        if hasattr(self,'actionSortieLegere') : return
+        self.actionSortieLegere = QAction(self)
+        self.actionSortieLegere.setText(tr("Sortie Legere"))
+        self.menuFichier.insertAction(self.actionEnregistrer_sous,self.actionSortieLegere)
+        self.actionSortieLegere.triggered.connect(self.handleSortieLegere)
+
+
+    def ZCRACKS(self):
+        self.enleverNewInclude()
+        self.toolBar.addSeparator()
+        self.ajoutExecution()
+
+        self.menuOptions = self.menubar.addMenu("menuOptions")
+        self.menuOptions.addAction(self.actionParametres_Eficas)
+        self.menuOptions.setTitle(tr("Options"))
+
+    def ADAO(self):
+        self.enleverActionsStructures()
+        self.enleverNewInclude()
 
     def ASTER(self) :
         self.menuTraduction = self.menubar.addMenu("menuTraduction")
-        self.actionTraduitV7V8 = QAction(self)
-        self.actionTraduitV7V8.setObjectName("actionTraduitV7V8")
-        self.actionTraduitV8V9 = QAction(self)
-        self.actionTraduitV8V9.setObjectName("actionTraduitV8V9")
-        self.actionTraduitV9V10 = QAction(self)
-        self.actionTraduitV9V10.setObjectName("actionTraduitV9V10")
-        self.menuTraduction.addAction(self.actionTraduitV7V8)
-        self.menuTraduction.addAction(self.actionTraduitV8V9)
+        self.menuTraduction.addAction(self.actionTraduitV11V12)
+        self.menuTraduction.addAction(self.actionTraduitV10V11)
         self.menuTraduction.addAction(self.actionTraduitV9V10)
-        self.menuTraduction.setTitle(QApplication.translate("Eficas", "Traduction", None, QApplication.UnicodeUTF8))
-        self.actionTraduitV7V8.setText(QApplication.translate("Eficas","TraduitV7V8", None, QApplication.UnicodeUTF8))
-        self.actionTraduitV8V9.setText(QApplication.translate("Eficas","TraduitV8V9", None, QApplication.UnicodeUTF8))
-        self.actionTraduitV9V10.setText(QApplication.translate("Eficas","TraduitV9V10", None, QApplication.UnicodeUTF8))
-        self.connect(self.actionTraduitV7V8,SIGNAL("activated()"),self.traductionV7V8)
-        self.connect(self.actionTraduitV8V9,SIGNAL("activated()"),self.traductionV8V9)
-        self.connect(self.actionTraduitV9V10,SIGNAL("activated()"),self.traductionV9V10)
+        self.menuTraduction.setTitle(tr("Traduction"))
 
+        self.menuFichier.addAction(self.actionSauveLigne)
 
+        self.menuOptions = self.menubar.addMenu("menuOptions")
+        self.menuOptions.addAction(self.actionParametres_Eficas)
+        self.menuOptions.addAction(self.actionLecteur_Pdf)
+        self.menuOptions.setTitle(tr("Options"))
 
     def CARMEL3D(self):
-        if self.salome == 0 : return
-        self.menuMesh = self.menubar.addMenu("menuMesh")
+        #if self.salome == 0 : return
+        self.enleverNewInclude()
+        self.menuMesh = self.menubar.addMenu(tr("Gestion Maillage"))
         self.menuMesh.setObjectName("Mesh")
-        self.actionChercheGrpMesh = QAction(self)
-        self.actionChercheGrpMesh.setText("Acquiert SubMeshes")
-        self.menuMesh.addAction(self.actionChercheGrpMesh)
-        self.connect(self.actionChercheGrpMesh,SIGNAL("activated()"),self.ChercheGrpMesh)
-        self.actionChercheGrpMaille = QAction(self)
-        self.actionChercheGrpMaille.setText("Acquiert Groupe Maille")
         self.menuMesh.addAction(self.actionChercheGrpMaille)
-        self.connect(self.actionChercheGrpMaille,SIGNAL("activated()"),self.ChercheGrpMaille)
+        #self.griserActionsStructures()
+
+    def CARMELCND(self):
+        self.enleverNewInclude()
+        self.enleverRechercherDsCatalogue()
+        self.ajoutExecution()
+        self.ajoutSauveExecution()
+        self.griserActionsStructures()
+        
+    def MAP(self):
+        self.enleverNewInclude()
+        self.toolBar.addSeparator()
+        self.ajoutExecution()
+        self.ajoutSauveExecution()
+        self.menuOptions = self.menubar.addMenu("menuOptions")
+        self.menuOptions.addAction(self.actionParametres_Eficas)
+        self.menuOptions.setTitle(tr("Options"))
+
+    def PSEN(self):
+        if self.first:  self.first=0
+        try : self.action_Nouveau.triggered.disconnect(self.fileNew)
+        except : pass
+        try : self.action_Nouveau.triggered.disconnect(self.newPSEN)
+        except : pass
+
+        self.action_Nouveau.triggered.connect(self.newPSEN)
+        self.enleverActionsStructures()
+        self.enleverParametres()
+        self.enleverRechercherDsCatalogue()
+        self.enleverNewInclude()
+        self.ajoutExecution()
+        self.ajoutN1()
+        self.ajoutHelpPSEN()
+        self.ajoutIcones()
+
+    def PSEN_N1(self):
+        self.enleverActionsStructures()
+        self.enleverParametres()
+        self.enleverRechercherDsCatalogue()
+        self.enleverNewInclude()
+        self.ajoutExecution()
+        self.ajoutIcones()
+
+    def TELEMAC(self):
+        self.enleverActionsStructures()
+        self.enleverNewInclude()
+        self.connectRechercherDsCatalogue()
+        self.ajoutSortieLegere()
+
+    def lookSuiteTelemac(self):
+        self.enleverActionsStructures()
+        self.enleverNewInclude()
+        self.enleverParametres()
+        self.enleverSupprimer()
+        self.enleverRechercherDsCatalogue()
+
+    def ajoutHelpPSEN(self):
+        self.actionParametres_Eficas.setText('Help PSEN')
+        self.actionParametres_Eficas.triggered.connect(self.aidePSEN)
+        
+
 
     def ChercheGrpMesh(self):
         Msg,listeGroup=self.ChercheGrpMeshInSalome()
         if Msg == None :
            self.viewmanager.handleAjoutGroup(listeGroup)
         else :
-           print "il faut gerer les erreurs"
+           print ("il faut gerer les erreurs")
 
     def ChercheGrpMaille(self):
-        Msg,listeGroup=self.ChercheGrpMailleInSalome()
+        # Normalement la variable self.salome permet de savoir si on est ou non dans Salome
+        try:
+            Msg,listeGroup=self.ChercheGrpMailleInSalome() # recherche dans Salome
+            #Msg = None; listeGroup = None # recherche manuelle, i.e., sans Salome si ligne precedente commentee
+        except:
+            raise ValueError('Salome non ouvert')
         if Msg == None :
            self.viewmanager.handleAjoutGroup(listeGroup)
         else :
-           print "il faut gerer les erreurs"
+           print ("il faut gerer les erreurs")
 
 
-    def MAP(self): 
-        self.menuExecution = self.menubar.addMenu(QApplication.translate("Eficas", "Execution", None, QApplication.UnicodeUTF8))
-        self.menuExecution.setObjectName("menuExecution")
-        self.menuJdC.setTitle(QApplication.translate("Eficas", "Rapports", None, QApplication.UnicodeUTF8))
+    def ChercheGrp(self):
+        #Msg,listeGroup=self.ChercheGrpMailleInSalome()
+        #if Msg == None :
+        #   self.viewmanager.handleAjoutGroup(listeGroup)
+        #else :
+        #print "il faut gerer "
+        pass
+
 
-        self.actionExecution = QAction(self)
-        icon6 = QIcon(self.RepIcon+"/compute.png")
-        self.actionExecution.setIcon(icon6)
-        self.actionExecution.setObjectName("actionExecution")
-        self.menuExecution.addAction(self.actionExecution)
-        self.toolBar.addAction(self.actionExecution)
-        self.actionExecution.setText(QApplication.translate("Eficas", "Execution Python", None, QApplication.UnicodeUTF8))
-        self.connect(self.actionExecution,SIGNAL("activated()"),self.run)
-
-        self.actionEnregistrer_Python = QAction(self)
-        self.actionEnregistrer_Python.setObjectName("actionEnregistrer_Python")
-        self.menuFichier.addAction(self.actionEnregistrer_Python)
-        self.actionEnregistrer_Python.setText(QApplication.translate("Eficas", "Sauve Python", None,QApplication.UnicodeUTF8))
-        self.connect(self.actionEnregistrer_Python,SIGNAL("activated()"),self.saveRun)
-
-        self.actionEnregistrerYACS = QAction(self)
-        self.actionEnregistrerYACS.setObjectName("actionEnregistrerYACS")
-        self.menuFichier.addAction(self.actionEnregistrerYACS)
-        self.actionEnregistrerYACS.setText(QApplication.translate("Eficas", "Sauve Schema YACS", None,QApplication.UnicodeUTF8))
-        self.connect(self.actionEnregistrerYACS,SIGNAL("activated()"),self.saveYACS)
-
-        self.actionExecutionYACS = QAction(self)
-        icon7 = QIcon(self.RepIcon+"/application.gif")
-        self.actionExecutionYACS.setIcon(icon7)
-        self.actionExecutionYACS.setObjectName("actionExecutionYACS")
-        self.menuExecution.addAction(self.actionExecutionYACS)
-        self.toolBar.addAction(self.actionExecutionYACS)
-        self.actionExecutionYACS.setText(QApplication.translate("Eficas", "Execution YACS", None, QApplication.UnicodeUTF8))
-        self.connect(self.actionExecutionYACS,SIGNAL("activated()"),self.runYACS)
-
-    def OPENTURNS_STUDY(self):
-        self.menuOptions.setDisabled(True)
-    
-    def OPENTURNS_WRAPPER(self):
-        self.menuOptions.setDisabled(True)
-    
     def ajoutIcones(self) :
         # Pour pallier les soucis de repertoire d icone
-        icon = QIcon(self.RepIcon+"/New24.png")
+        #print self.repIcon
+        icon = QIcon(self.repIcon+"/new_file.png")
         self.action_Nouveau.setIcon(icon)
-        icon1 = QIcon(self.RepIcon+"/Open24.png")
-        self.action_Ouvrir.setIcon(icon1)
-        icon2 = QIcon(self.RepIcon+"/Save24.png")
+        icon1 = QIcon(self.repIcon+"/ouvrir.png")
+        self.actionOuvrir.setIcon(icon1)
+        icon2 = QIcon(self.repIcon+"/save.png")
         self.actionEnregistrer.setIcon(icon2)
-        icon3 = QIcon(self.RepIcon+"/Cut24.png")
-        self.actionCouper.setIcon(icon3)
-        icon4 = QIcon(self.RepIcon+"/Copy24.png")
-        self.actionCopier.setIcon(icon4)
-        icon5 = QIcon(self.RepIcon+"/Paste24.png")
-        self.actionColler.setIcon(icon5)
+        icon6 = QIcon(self.repIcon+"/delete.png")
+        self.actionSupprimer.setIcon(icon6)
+        icon7 = QIcon(self.repIcon+"/roue.png")
+        self.actionExecution.setIcon(icon7)
 
 
-    def connecterSignaux(self) :
+
+   
+    def connecterSignauxQT4(self) :
         self.connect(self.recentMenu,SIGNAL('aboutToShow()'),self.handleShowRecentMenu)
 
-       self.connect(self.action_Nouveau,SIGNAL("activated()"),self.fileNew)
-        self.connect(self.actionNouvel_Include,SIGNAL("activated()"),self.NewInclude)
-        self.connect(self.action_Ouvrir,SIGNAL("activated()"),self.fileOpen)
-        self.connect(self.actionEnregistrer,SIGNAL("activated()"),self.fileSave)
-        self.connect(self.actionEnregistrer_sous,SIGNAL("activated()"),self.fileSaveAs)
-        self.connect(self.actionFermer,SIGNAL("activated()"),self.fileClose)
-        self.connect(self.actionFermer_tout,SIGNAL("activated()"),self.fileCloseAll)
-        self.connect(self.actionQuitter,SIGNAL("activated()"),self.fileExit)
+        self.connect(self.action_Nouveau,SIGNAL("triggered()"),self.fileNew)
+        self.connect(self.actionNouvel_Include,SIGNAL("triggered()"),self.NewInclude)
+        self.connect(self.actionOuvrir,SIGNAL("triggered()"),self.fileOpen)
+        self.connect(self.actionEnregistrer,SIGNAL("triggered()"),self.fileSave)
+        self.connect(self.actionEnregistrer_sous,SIGNAL("triggered()"),self.fileSaveAs)
+        self.connect(self.actionFermer,SIGNAL("triggered()"),self.fileClose)
+        self.connect(self.actionFermer_tout,SIGNAL("triggered()"),self.fileCloseAll)
+        self.connect(self.actionQuitter,SIGNAL("triggered()"),self.fileExit)
+
+        self.connect(self.actionEficas,SIGNAL("triggered()"),self.aidePPal)
+        self.connect(self.actionVersion,SIGNAL("triggered()"),self.version)
+        self.connect(self.actionParametres,SIGNAL("triggered()"),self.gestionParam)
+
+        self.connect(self.actionCouper,SIGNAL("triggered()"),self.editCut)
+        self.connect(self.actionCopier,SIGNAL("triggered()"),self.editCopy)
+        self.connect(self.actionColler,SIGNAL("triggered()"),self.editPaste)
+        self.connect(self.actionSupprimer,SIGNAL("triggered()"),self.supprimer)
+        self.connect(self.actionRechercher,SIGNAL("triggered()"),self.rechercher)
+        self.connect(self.actionDeplier_replier,SIGNAL("triggered()"),self.Deplier)
+
+        self.connect(self.actionRapport_de_Validation,SIGNAL("triggered()"),self.jdcRapport)
+        self.connect(self.actionRegles_du_JdC,SIGNAL("triggered()"),self.jdcRegles)
+        self.connect(self.actionFichier_Source,SIGNAL("triggered()"),self.jdcFichierSource)
+        self.connect(self.actionFichier_Resultat,SIGNAL("triggered()"),self.visuJdcPy)
+
+
+
+
+        # Pour Aster
+        self.actionTraduitV9V10 = QAction(self)
+        self.actionTraduitV9V10.setObjectName("actionTraduitV9V10")
+        self.actionTraduitV9V10.setText(tr("TraduitV9V10"))
+        self.actionTraduitV10V11 = QAction(self)
+        self.actionTraduitV10V11.setObjectName("actionTraduitV10V11")
+        self.actionTraduitV10V11.setText(tr("TraduitV10V11"))
+        self.actionTraduitV11V12 = QAction(self)
+        self.actionTraduitV11V12.setObjectName("actionTraduitV11V12")
+        self.actionTraduitV11V12.setText(tr("TraduitV11V12"))
+        self.actionSauveLigne = QAction(self)
+        self.actionSauveLigne.setText(tr("Sauve Format Ligne"))
+
+        #self.connect(self.actionParametres_Eficas,SIGNAL("triggered()"),self.optionEditeur)
+        self.connect(self.actionLecteur_Pdf,SIGNAL("triggered()"),self.optionPdf)
+        self.connect(self.actionTraduitV9V10,SIGNAL("triggered()"),self.traductionV9V10)
+        self.connect(self.actionTraduitV10V11,SIGNAL("triggered()"),self.traductionV10V11)
+        self.connect(self.actionTraduitV11V12,SIGNAL("triggered()"),self.traductionV11V12)
+        self.connect(self.actionSauveLigne,SIGNAL("triggered()"),self.sauveLigne)
+
+
+        # Pour Carmel
+        self.actionChercheGrpMaille = QAction(self)
+        self.actionChercheGrpMaille.setText(tr("Acquiert groupe mailles"))
+        self.connect(self.actionChercheGrpMaille,SIGNAL("triggered()"),self.ChercheGrpMaille)
+
+        # Pour CarmelCND
+        self.actionChercheGrp = QAction(self)
+        self.actionChercheGrp.setText(tr("Acquisition Groupe Maille"))
+        self.connect(self.actionChercheGrp,SIGNAL("triggered()"),self.ChercheGrp)
+
+        # Pour Aide
+        self.actionCode = QAction(self)
+        self.actionCode.setText(tr("Specificites Maille"))
+        self.connect(self.actionCode,SIGNAL("triggered()"),self.aideCode)
+
+    def connecterSignaux(self) :
+
+        self.recentMenu.aboutToShow.connect(self.handleShowRecentMenu)
+        self.action_Nouveau.triggered.connect(self.fileNew)
+        self.actionNouvel_Include.triggered.connect(self.NewInclude)
+        self.actionOuvrir.triggered.connect(self.fileOpen)
+        self.actionEnregistrer.triggered.connect(self.fileSave)
+        self.actionEnregistrer_sous.triggered.connect(self.fileSaveAs)
+        self.actionFermer.triggered.connect(self.fileClose)
+        self.actionFermer_tout.triggered.connect(self.fileCloseAll)
+        self.actionQuitter.triggered.connect(self.fileExit)
+
+        self.actionEficas.triggered.connect(self.aidePPal)
+        self.actionVersion.triggered.connect(self.version)
+        self.actionParametres.triggered.connect(self.gestionParam)
+        self.actionCommentaire.triggered.connect(self.ajoutCommentaire)
+
+        self.actionCouper.triggered.connect(self.editCut)
+        self.actionCopier.triggered.connect(self.editCopy)
+        self.actionColler.triggered.connect(self.editPaste)
+        self.actionSupprimer.triggered.connect(self.supprimer)
+        self.actionRechercher.triggered.connect(self.rechercher)
+        self.actionDeplier_replier.triggered.connect(self.Deplier)
+
+        self.actionRapport_de_Validation.triggered.connect(self.jdcRapport)
+        self.actionRegles_du_JdC.triggered.connect(self.jdcRegles)
+        self.actionFichier_Source.triggered.connect(self.jdcFichierSource)
+        self.actionFichier_Resultat.triggered.connect(self.visuJdcPy)
+        self.actionAfficher_l_Arbre.triggered.connect(self.ouvreArbre)
+        self.actionCacher_l_Arbre.triggered.connect(self.fermeArbre)
+
+
+        # Pour Aster
+        self.actionTraduitV9V10 = QAction(self)
+        self.actionTraduitV9V10.setObjectName("actionTraduitV9V10")
+        self.actionTraduitV9V10.setText(tr("TraduitV9V10"))
+        self.actionTraduitV10V11 = QAction(self)
+        self.actionTraduitV10V11.setObjectName("actionTraduitV10V11")
+        self.actionTraduitV10V11.setText(tr("TraduitV10V11"))
+        self.actionTraduitV11V12 = QAction(self)
+        self.actionTraduitV11V12.setObjectName("actionTraduitV11V12")
+        self.actionTraduitV11V12.setText(tr("TraduitV11V12"))
+        self.actionSauveLigne = QAction(self)
+        self.actionSauveLigne.setText(tr("Sauve Format Ligne"))
+
+        #self.actionParametres_Eficas.triggered.connect(self.optionEditeur)
+        self.actionTraduitV9V10.triggered.connect(self.traductionV9V10)
+        self.actionTraduitV10V11.triggered.connect(self.traductionV10V11)
+        self.actionTraduitV11V12.triggered.connect(self.traductionV11V12)
+        self.actionSauveLigne.triggered.connect(self.sauveLigne)
+
+        # Pour Carmel
+        self.actionChercheGrpMaille = QAction(self)
+        self.actionChercheGrpMaille.setText(tr("Acquiert Groupe Maille"))
 
-        self.connect(self.actionEficas,SIGNAL("activated()"),self.aidePPal)
-        self.connect(self.actionVersion,SIGNAL("activated()"),self.version)
+        # Pour CarmelCND
+        self.actionChercheGrp = QAction(self)
+        self.actionChercheGrp.setText(tr("Accquisition Groupe Maille"))
+        self.actionChercheGrp.triggered.connect(self.ChercheGrp)
 
-        self.connect(self.actionCouper,SIGNAL("activated()"),self.editCut)
-        self.connect(self.actionCopier,SIGNAL("activated()"),self.editCopy)
-        self.connect(self.actionColler,SIGNAL("activated()"),self.editPaste)
-        self.connect(self.actionSupprimer,SIGNAL("activated()"),self.supprimer)
+        # Pour Aide
+        self.actionCode = QAction(self)
+        self.actionCode.setText(tr("Specificites Maille"))
+        self.actionCode.triggered.connect(self.aideCode)
 
-        self.connect(self.actionRapport_de_Validation,SIGNAL("activated()"),self.jdcRapport)
-        self.connect(self.actionFichier_Source,SIGNAL("activated()"),self.jdcFichierSource)
-        self.connect(self.actionFichier_Resultat,SIGNAL("activated()"),self.visuJdcPy)
 
-        self.connect(self.actionParametres_Eficas,SIGNAL("activated()"),self.optionEditeur)
-        self.connect(self.actionLecteur_Pdf,SIGNAL("activated()"),self.optionPdf)
+    def Deplier(self):
+        self.viewmanager.handleDeplier()
 
-        #self.connect(self.helpIndexAction,SIGNAL("activated()"),self.helpIndex)
-        #self.connect(self.helpContentsAction,SIGNAL("activated()"),self.helpContents)
-                             
+    def ajoutCommentaire(self):
+        self.viewmanager.ajoutCommentaire()
 
     def ouvreFichiers(self) :
     # Ouverture des fichiers de commandes donnes sur la ligne de commande
@@ -230,6 +632,7 @@ class Appli(Ui_Eficas,QMainWindow):
             d=session.get_unit(study,self)
             self.viewmanager.handleOpen(fichier=study["comm"],units=d)
 
+
     def  get_source(self,file):
     # appele par Editeur/session.py
         import convert
@@ -238,37 +641,46 @@ class Appli(Ui_Eficas,QMainWindow):
         texte=p.convert('execnoparseur')
         return texte
 
-
-        
     def initPatrons(self) :
-    # Mise à jour du menu des fichiers recemment ouverts
+    # Mise a jour du menu des fichiers recemment ouverts
         from Editeur import listePatrons
-        if not(self.code in listePatrons.sous_menus.keys()) :
+        if not(self.code in listePatrons.sous_menus) :
+           if hasattr(self,"menuPatrons"):
+              self.menuPatrons.setAttribute(Qt.WA_DeleteOnClose)
+              self.menuPatrons.close()
+              delattr(self,"menuPatrons")
            return
-        self.menuPatrons = QMenu(self.menubar)
-        self.menuPatrons.setObjectName("menuPatrons")
-        self.menubar.addAction(self.menuPatrons.menuAction())
-        self.menuPatrons.setTitle(QApplication.translate("Eficas", "Patrons", None, QApplication.UnicodeUTF8))
+        if (not hasattr(self,"menuPatrons")):
+           self.menuPatrons = QMenu(self.menubar)
+           self.menuPatrons.setObjectName("menuPatrons")
+           self.menubar.addAction(self.menuPatrons.menuAction())
+           self.menuPatrons.setTitle(tr("Patrons"))
+        else :
+           self.menuPatrons.clear()
         self.listePatrons = listePatrons.listePatrons(self.code)
         idx = 0
-        for nomSsMenu in self.listePatrons.liste.keys():
+        for nomSsMenu in self.listePatrons.liste:
             ssmenu=self.menuPatrons.addMenu(nomSsMenu)
             for fichier in self.listePatrons.liste[nomSsMenu]:
                id = ssmenu.addAction(fichier)
                self.ficPatrons[id]=fichier
-               self.connect(id, SIGNAL('triggered()'),self.handleOpenPatrons)
+               self.id.triggered.connect(self.handleOpenPatrons)
             #   self.Patrons.setItemParameter(id,idx)
                idx=idx+1
 
     def initRecents(self):
+       self.recent =  []
        try :
-           rep=self.CONFIGURATION.rep_user
+           if sys.platform[0:5]=="linux" :
+              rep=os.path.join(os.environ['HOME'],'.config/Eficas',self.code)
+           else :
+              rep=os.path.join('C:/','.config/Eficas',self.code)
            monFichier=rep+"/listefichiers_"+self.code
            index=0
            f=open(monFichier)
            while ( index < 9) :
               ligne=f.readline()
-              if ligne != "" :
+              if ligne != "" : 
                  l=(ligne.split("\n"))[0]
                  self.recent.append(l)
               index=index+1
@@ -279,6 +691,13 @@ class Appli(Ui_Eficas,QMainWindow):
        except : pass
 
     def addToRecentList(self, fn):
+      while fn in self.recent: self.recent.remove(fn)
+      self.recent.insert(0,fn)
+      if len(self.recent) > 9:
+         self.recent = self.recent[:9]
+
+
+    def addToRecentListQT4(self, fn):
         """
         Public slot to add a filename to the list of recently opened files.
 
@@ -288,10 +707,15 @@ class Appli(Ui_Eficas,QMainWindow):
         self.recent.prepend(fn)
         if len(self.recent) > 9:
             self.recent = self.recent[:9]
+        index=0
+        self.sauveRecents()
 
     def sauveRecents(self) :
-       rep=self.CONFIGURATION.rep_user
-       monFichier=rep+"/listefichiers_"+self.code
+       try :
+         rep=self.CONFIGURATION.rep_user
+         monFichier=rep+"/listefichiers_"+self.code
+       except :
+         return
        try :
             f=open(monFichier,'w')
             if len(self.recent) == 0 : return
@@ -309,68 +733,98 @@ class Appli(Ui_Eficas,QMainWindow):
 
 
 
-    def traductionV7V8(self):
-        from gereTraduction import traduction
-        traduction(self.CONFIGURATION.rep_ini,self.viewmanager,"V7V8")
+    def traductionV11V12(self):
+        from .gereTraduction import traduction
+        traduction(self.CONFIGURATION.repIni,self.viewmanager,"V11V12")
 
-    def traductionV8V9(self):
-        from gereTraduction import traduction
-        traduction(self.CONFIGURATION.rep_ini,self.viewmanager,"V8V9")
+    def traductionV10V11(self):
+        from .gereTraduction import traduction
+        traduction(self.CONFIGURATION.repIni,self.viewmanager,"V10V11")
 
     def traductionV9V10(self):
-        from gereTraduction import traduction
-        traduction(self.CONFIGURATION.rep_ini,self.viewmanager,"V9V10")
+        from .gereTraduction import traduction
+        traduction(self.CONFIGURATION.repIni,self.viewmanager,"V9V10")
 
     def version(self) :
-        from monVisu import DVisu
-        titre = "version "
+        from .monVisu import DVisu
+        titre = tr("version ")
         monVisuDialg=DVisu(parent=self,fl=0)
         monVisuDialg.setWindowTitle(titre)
-        monVisuDialg.TB.setText(self.VERSION_EFICAS +QString(" pour ") + self.code)
+        monVisuDialg.TB.setText(self.VERSION_EFICAS +tr(" pour ") + self.code)
         monVisuDialg.adjustSize()
         monVisuDialg.show()
 
     def aidePPal(self) :
-        maD=self.INSTALLDIR+"/Aide"
-        docsPath = QDir(maD).absolutePath()
+        repAide=os.path.dirname(os.path.abspath(__file__))
+        maD=os.path.join( repAide,'..','Doc','html')
         try :
-          monAssistant=QAssistantClient(QString(""), self)
-          arguments=QStringList()
-          arguments << "-profile" <<docsPath+QDir.separator()+QString("eficas_")+QString(self.code)+QString(".adp");
-          monAssistant.setArguments(arguments);
-          monAssistant.showPage(docsPath+QDir.separator()+QString("fichiers_"+QString(self.code)+QString("/index.html")))
+          indexAide=os.path.join(maD,'index.html')
+          if sys.platform[0:5]=="linux" : cmd="xdg-open "+indexAide
+          else                          : cmd="start "+indexAide
+          os.system(cmd)
         except:
-           QMessageBox.warning( self, "Aide Indisponible", "QT Assistant n est pas installe ")
+          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+
+    def aidePSEN(self) :
+        repAide=os.path.dirname(os.path.abspath(__file__))
+        maD=os.path.join( repAide,'..','Doc','html')
+        try :
+          indexAide=os.path.join(maD,'index.html')
+          if sys.platform[0:5]=="linux" : cmd="xdg-open "+indexAide
+          else                          : cmd="start "+indexAide
+          os.system(cmd)
+        except:
+          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
+
+    def aideCode(self) :
+        if self.code==None : return
+        try :
+        #if 1 :
+          if sys.platform[0:5]=="linux" : cmd="xdg-open "+self.fileDoc
+          else                          : cmd="start "+self.fileDoc
+          os.system(cmd)
+        except:
+        #else:
+          QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
 
 
     def optionEditeur(self) :
-        name='monOptions_'+self.code
         try :
+           name='monOptions_'+self.code
+        except :
+           QMessageBox.critical( self,tr( "Parametrage"),tr( "Veuillez d abord choisir un code"))
+           return
+        try :
+        #if 1:
            optionCode=__import__(name)
         except :
-           QMessageBox.critical( self, "Parametrage", "Pas de possibilite de personnalisation de la configuration ")
+        #else :
+           QMessageBox.critical( self, tr("Parametrage"), tr("Pas de possibilite de personnalisation de la configuration "))
            return
         monOption=optionCode.Options(parent=self,modal = 0 ,configuration=self.CONFIGURATION)
         monOption.show()
-        
+
     def optionPdf(self) :
         from monOptionsPdf import OptionPdf
         monOption=OptionPdf(parent=self,modal = 0 ,configuration=self.CONFIGURATION)
         monOption.show()
-        
+
+    def handleSortieLegere(self):
+        return self.viewmanager.saveLegerCurrentEditor()
+
     def handleShowRecentMenu(self):
         """
         Private method to set up recent files menu.
         """
         self.recentMenu.clear()
-        
+
         for rp in self.recent:
             id = self.recentMenu.addAction(rp)
             self.ficRecents[id]=rp
-            self.connect(id, SIGNAL('triggered()'),self.handleOpenRecent)
+            id.triggered.connect(self.handleOpenRecent)
         self.recentMenu.addSeparator()
-        self.recentMenu.addAction(self.trUtf8('&Clear'), self.handleClearRecent)
-        
+        self.recentMenu.addAction(tr('&Effacer'), self.handleClearRecent)
+
     def handleOpenPatrons(self):
         idx=self.sender()
         fichier=self.repIni+"/../Editeur/Patrons/"+self.code+"/"+self.ficPatrons[idx]
@@ -380,94 +834,136 @@ class Appli(Ui_Eficas,QMainWindow):
         idx=self.sender()
         fichier=self.ficRecents[idx]
         self.viewmanager.handleOpen(fichier=fichier, patron =0 )
-        
+
     def handleClearRecent(self):
         self.recent = QStringList()
         self.sauveRecents()
+
+    def handleRechercherDsCatalogue(self):
+        if not self.viewmanager : return
+        self.viewmanager.handleRechercherDsCatalogue()
+
+    def fileNew(self):
+        try:
+            self.viewmanager.newEditor()
+        except EficasException as exc:
+            msg = six.text_type(exc)
+            if msg != "": QMessageBox.warning(self, tr(u"Erreur"), msg)
+
+    def openProcess(self):
+        ssCode=None
+        code="PSEN_N1"
+        self.cleanPath()
+        dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',"ProcessOutputs_Eficas"))
+        sys.path.insert(0,dirCode)
+        self.code=code
+        self.definitCode(code,ssCode)
+        self.multi=True
+        self.demande=False
+        self.initRecents()
+        self.fileOpen()
         
-    def fileNew(self):        
-        self.viewmanager.newEditor()        
-        
-    def fileOpen(self ):
-        self.viewmanager.handleOpen()        
-        
+
+    def fileOpen(self):
+        try:
+            self.viewmanager.handleOpen()
+        except EficasException as exc:
+            msg = six.text_type(exc)
+            if msg != "":
+                QMessageBox.warning(self, tr(u"Erreur"), msg)
+
+    def sauveLigne(self):
+        return self.viewmanager.sauveLigneCurrentEditor()
+
     def fileSave(self):
         return self.viewmanager.saveCurrentEditor()
-        
+
     def fileSaveAs(self):
         return self.viewmanager.saveAsCurrentEditor()
-        
+
     def fileClose(self):
         self.viewmanager.handleClose(texte='&Fermer')
-        
+
     def fileCloseAll(self):
         self.viewmanager.handleCloseAll(texte='&Fermer')
-        
+
     def fileExit(self):
         # On peut sortir sur Abort
         res=self.viewmanager.handleCloseAll()
-        if (res != 2) : 
-           if self.salome :
-              self.close()
-           else :
-              qApp.closeAllWindows()
-        
+        if (res != 2) :
+            self.close()
+        return res
+
     def editCopy(self):
         self.viewmanager.handleEditCopy()
-      
+
     def editCut(self):
         self.viewmanager.handleEditCut()
-    
+
     def editPaste(self):
         self.viewmanager.handleEditPaste()
-        
+
+    def rechercher(self):
+        self.viewmanager.handleRechercher()
+
     def run(self):
         self.viewmanager.run()
-        
+
     def saveRun(self):
         self.viewmanager.saveRun()
-        
-    def runYACS(self):
-        self.viewmanager.runYACS()
-        
-    def saveYACS(self):
-        self.viewmanager.saveYACS()
-        
+
+
     def supprimer(self):
         self.viewmanager.handleSupprimer()
-        
+
     def jdcFichierSource(self):
         self.viewmanager.handleViewJdcFichierSource()
-        
+
     def jdcRapport(self):
         self.viewmanager.handleViewJdcRapport()
-        
+
+    def jdcRegles(self):
+        self.viewmanager.handleViewJdcRegles()
+
+    def gestionParam(self):
+        self.viewmanager.handlegestionParam()
+
     def visuJdcPy(self):
         self.viewmanager.handleViewJdcPy()
 
+    def ouvreArbre(self):
+        self.viewmanager.ouvreArbre()
+
+    def fermeArbre(self):
+        self.viewmanager.fermeArbre()
 
     def NewInclude(self):
         self.viewmanager.newIncludeEditor()
 
-    def getName(self):
-        self.indice=self.indice+1
-        texte="tempo"+str(self.indice)
-        return texte
-        
     def cleanPath(self):
-        for pathCode in ('Aster','Carmel3D','Cuve2dg','Openturns_Study','Openturns_Wrapper','MAP'):
+        for pathCode in self.ListePathCode:
+            try:
+              aEnlever=os.path.abspath(os.path.join(os.path.dirname(__file__),'..',pathCode))
+              sys.path.remove(aEnlever)
+            except :
+              pass
+        for pathCode in self.listeAEnlever:
             try:
-              aEnlever=os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__),'..',pathCode)))
               sys.path.remove(aEnlever)
             except :
               pass
-              
+
+
+    def closeEvent(self,event):
+      res=self.fileExit()
+      if res==2 : event.ignore()
 
 
 if __name__=='__main__':
 
     # Modules Eficas
-    sys.path.append(INSTALLDIR+"/Aster")
+    rep=os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__),'..','ASTER')))
+    sys.path.append(rep)
     from Aster import prefsCode
     if hasattr(prefsCode,'encoding'):
        # Hack pour changer le codage par defaut des strings
@@ -490,7 +986,6 @@ if __name__=='__main__':
     Eficas=Appli()
     Eficas.show()
 
-    #app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
     #mw.ouvreFichiers()
     #mw.show()