From: Pascale Noyret Date: Mon, 7 Nov 2011 10:39:55 +0000 (+0000) Subject: multi catalogue X-Git-Tag: LOGILAB~283 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a7cd0ef6cac94918939c05b68dbcce28b055b08;p=tools%2Feficas.git multi catalogue --- diff --git a/InterfaceQT4/monChoixCode.py b/InterfaceQT4/monChoixCode.py new file mode 100644 index 00000000..a5323a62 --- /dev/null +++ b/InterfaceQT4/monChoixCode.py @@ -0,0 +1,67 @@ +# -*- 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() diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index ba237f06..77cd6878 100644 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -26,15 +26,15 @@ class Appli(Ui_Eficas,QMainWindow): 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() @@ -52,14 +52,11 @@ class Appli(Ui_Eficas,QMainWindow): 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) diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index f5ad6ea9..6d9eaeae 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -194,6 +194,7 @@ class READERCATA: if self.appliEficas.top: self.appliEficas.setWindowTitle(titre) self.appliEficas.titre=titre + self.QWParent.titre=titre def determineMater(self) : # Determinination du repertoire materiau diff --git a/InterfaceQT4/viewManager.py b/InterfaceQT4/viewManager.py index 34c39cc6..23aec468 100644 --- a/InterfaceQT4/viewManager.py +++ b/InterfaceQT4/viewManager.py @@ -46,6 +46,7 @@ class MyTabview: 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 @@ -121,7 +122,7 @@ class MyTabview: return res def handleEditCopy(self): - print "passage dans handleEditCopy" + #print "passage dans handleEditCopy" index=self.myQtab.currentIndex() editor=self.dict_editors[index] editor.handleEditCopy()