--- /dev/null
+# -*- coding: utf-8 -*-
+# CONFIGURATION MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM 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
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
+# ======================================================================
+# Modules Python
+# Modules Eficas
+
+import os,sys
+from desChoixCode import Ui_ChoixCode
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+
+
+
+# Import des panels
+
+class MonChoixCode(Ui_ChoixCode,QDialog):
+ """
+ Classe définissant le panel associé aux mots-clés qui demandent
+ à l'utilisateur de choisir une seule valeur parmi une liste de valeurs
+ discrètes
+ """
+ def __init__(self, parentAppli=None):
+ QDialog.__init__(self,parentAppli)
+ self.setModal(True)
+ self.setupUi(self)
+ self.parentAppli=parentAppli
+ self.verifieInstall()
+ self.code=None
+ self.connect(self.pB_OK,SIGNAL("clicked()"),self.choisitCode)
+
+ def verifieInstall(self):
+ self.groupCodes=QButtonGroup(self)
+ for code in ('Aster','Cuve2dg','MAP','Openturns_Study','Openturns_Wrapper'):
+ nom='rB_'+code
+ bouton=getattr(self,nom)
+ dirCode=os.path.abspath(os.path.join(os.getcwd(),'..',code))
+ try :
+ l=os.listdir(dirCode)
+ self.groupCodes.addButton(bouton)
+ except :
+ bouton.close()
+
+
+ def choisitCode(self):
+ bouton=self.groupCodes.checkedButton()
+ code=str(bouton.text())
+ codeUpper=code.upper()
+ self.parentAppli.code=codeUpper
+ sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..',code)))
+ self.close()
self.VERSION_EFICAS="Eficas QT4 V6.3.1"
self.salome=salome
self.ihm="QT"
- self.top = self #(pour CONFIGURATION)
+ self.top = self #(pour CONFIGURATION)
self.QWParent=None #(Pour lancement sans IHM)
self.indice=0
self.dict_reels={}
self.multi=multi
if self.multi == False :self.definitCode(code,ssCode)
+ self.RepIcon=os.path.abspath(os.path.join(os.getcwd(),'../Editeur/icons'))
eficas_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- self.RepIcon = os.path.join(eficas_root_dir, "Editeur", "icons")
self.ajoutIcones()
def definitCode(self,code,ssCode) :
self.code=code
self.ssCode=ssCode
+ self.cleanPath()
if self.code==None :
- self.code=raw_input("Entrez le code : ")
- pathCode=raw_input("Entrez le chemin : ")
-
- self.cleanPath()
- import sys
- sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..',pathCode)))
- # a faire dans le panel de choix du code Aster Cuve2Dg ou MAP
+ from monChoixCode import MonChoixCode
+ widgetChoix = MonChoixCode(self)
+ ret=widgetChoix.exec_()
name='prefs_'+self.code
prefsCode=__import__(name)
if self.dict_editors.has_key(index):
editor=self.dict_editors[index]
self.appliEficas.CONFIGURATION=editor.CONFIGURATION
+ self.appliEficas.setWindowTitle(editor.titre)
def handleOpen(self,fichier=None,patron=0,units=None):
result = None
return res
def handleEditCopy(self):
- print "passage dans handleEditCopy"
+ #print "passage dans handleEditCopy"
index=self.myQtab.currentIndex()
editor=self.dict_editors[index]
editor.handleEditCopy()