self.lecture_catalogues_standard()
self.lecture_fichier_ini_utilisateur()
self.init_liste_param()
- self.pref="style."
#--------------------------------------
def lecture_fichier_ini_standard(self):
self.catalogues= os.path.join(self.rep_ini,'..','Cata/cata.py')
self.isdeveloppeur='NON'
self.path_cata_dev=os.path.join(self.rep_user,'cata')
-
CONFIGbase.__init__ (self,appli)
+ self.pref=""
class CONFIGStyle(CONFIGbase):
self.YesNo={}
self.l_param=[]
CONFIGbase.__init__ (self,appli)
+ self.pref="style."
def affichage_style_ini(self):
self.affichage_fichier_ini()
-# -*- coding: iso-8859-1 -*-
+#i -*- coding: iso-8859-1 -*-
# Modules Python
import types,sys,os
import prefs
import qtCommun
-VERSION_EFICAS = "EFICAS v1.13"
+VERSION_EFICAS = "EFICAS v1.14"
# -------------------------- #
if hasattr(qApp.mainWidget(),"statusBar"):
self.sb = qApp.mainWidget().statusBar()
- self.parent = parent
self.vm = parent #viewManager
self.fileName = fn
self.fileInfo = None
self.modified = False
self.isReadOnly = False
- if not hasattr( readercata, 'reader' ):
+ if not hasattr( readercata, 'reader' ) :
readercata.reader = readercata.READERCATA( self, self )
self.readercata = readercata.reader
self.stop_modif()
if self.code == "OPENTURNS" :
self.writeFilesOpenturns(fn)
+ if self.salome :
+ self.parent.appli.addJdcInSalome( self.fileName)
+ if self.code == 'ASTER':
+ self.parent.appli.createOrUpdateMesh(self)
+ #PN ; TODO
+
+
return (1, self.fileName)
else:
return (0, None)
discrètes
"""
def __init__(self,node, parent = None,name = None,fl = 0):
+ self.editor=parent
QTPanel.__init__(self,node,parent)
DUnBase.__init__(self,parent,name,fl)
self.politique=PolitiqueUnique(node,parent)
self.InitLineEditVal()
self.InitCommentaire()
+ self.detruitBouton()
def ViewDoc(self):
QTPanel.ViewDoc(self)
+ def detruitBouton(self):
+ mc = self.node.item.get_definition()
+ type = mc.type[0]
+ #if not('grma' in repr(type)):
+ if not('grma' in repr(type)) or not(self.editor.salome) :
+ self.BSalome.close()
+
def InitLineEditVal(self):
valeur=self.node.item.get_valeur()
valeurTexte=self.politique.GetValeurTexte(valeur)
str=QString(valeurTexte)
self.lineEditVal.setText(str)
+
def InitCommentaire(self):
mc = self.node.item.get_definition()
d_aides = { 'TXM' : "Une chaîne de caractères est attendue",
def Ajout1Valeur(self,valeur):
SaisieValeur.LEValeurPressed(self,valeur)
+
+ def BSalomePressed(self):
+ genea=self.node.item.get_genealogie()
+ kwType = None
+ for e in genea:
+ if "GROUP_NO" in e: kwType = "GROUP_NO"
+ if "GROUP_MA" in e: kwType = "GROUP_MA"
+
+ selection, commentaire = self.editor.parent.appliEficas.selectGroupFromSalome(kwType,editor=self.editor)
+ if commentaire !="" :
+ self.Commentaire.setText(QString(commentaire))
+ monTexte=""
+ if selection == [] : return
+ for geomElt in selection:
+ monTexte=geomElt+","
+ monTexte= monTexte[0:-1]
+ self.LEValeur.setText(QString(monTexte))
+
if valeur != "" and valeur != None :
self.LESDCO.setText(QString(valeur.nom))
- def BOuiPressed(self):
- self.rbOui.setChecked(1)
- self.rbNon.setChecked(0)
- self.LESDCO.setEnabled(1)
- self.disconnect(self.LBSDCO,SIGNAL("clicked(QListBoxItem*)"),self.LBSDCOReturnPressed)
- self.LBSDCO.clear()
-
- def BNonPressed(self):
- self.rbOui.setChecked(0)
- self.rbNon.setChecked(1)
- self.LESDCO.setEnabled(0)
- self.initLBSDCO()
- self.connect(self.LBSDCO,SIGNAL("clicked(QListBoxItem*)"),self.LBSDCOReturnPressed)
def LBSDCOReturnPressed(self):
"""
- si non, restaure l'ancienne valeur
"""
nomConcept=str(self.LBSDCO.currentText())
+ self.LESDCO.clear()
self.editor.init_modif()
anc_val = self.node.item.get_valeur()
test_CO=self.node.item.is_CO(anc_val)
self.Commentaire.setText(commentaire)
def LESDCOReturnPressed(self) :
+ self.LBSDCO.clearSelection()
SaisieSDCO.LESDCOReturnPressed(self)
def BOkPressed(self):
QObject.connect( self.LBNouvCommande, SIGNAL("returnPressed(QListBoxItem*)"),self.DefCmd )
def DefCmd(self):
+ print self.editor.focusWidget()
+ print self.LBNouvCommande
if (self.editor.focusWidget())!=self.LBNouvCommande :
return
if self.LBNouvCommande.selectedItem()== 0 : return
"""
Class implementing the main user interface.
"""
- def __init__(self,code="ASTER",salome=0):
+ def __init__(self,code="ASTER",salome=0,parent=None):
"""
Constructor
self.ihm="QT"
self.code=code
self.salome=salome
- Eficas.__init__(self)
+ Eficas.__init__(self,parent,fl=Qt.WType_Dialog)
+ #Eficas.__init__(self,parent)
if code == "ASTER" :
from Aster import prefs
+ import sys
sys.path.append(INSTALLDIR+"/Aster")
else :
import prefs
#except :
else:
pass
+ if hasattr(prefs,'encoding'):
+ import sys
+ reload(sys)
+ sys.setdefaultencoding(prefs.encoding)
+ del sys.setdefaultencoding
+
self.top=self
self.CONFIGURATION = configuration.make_config(self,prefs.REPINI)
self.CONFIGStyle = configuration.make_config_style(self,prefs.REPINI)
self.initPatrons()
self.monAssistant=QAssistantClient(QString(""), self.viewmanager)
+ if self.salome :
+ from Editeur import session
+ self.ouvreFichiers()
def OPENTURNS(self) :
self.MenuBar.removeItem(5)
maD=INSTALLDIR+"/AIDE/fichiers"
docsPath = QDir(maD).absPath()
self.monAssistant.showPage( QString("%1/index.html").arg(docsPath) )
+
+ def optionEditeur(self) :
+ from OptionsEditeur import Options
+ monOption=Options(parent=self.viewmanager,fl=Qt.WType_Dialog)
+ monOption.show()
def handleShowRecentMenu(self):
"""
def fileExit(self):
self.viewmanager.handleCloseAll()
- qApp.closeAllWindows()
+ if self.salome :
+ self.close()
+ else :
+ qApp.closeAllWindows()
def editCopy(self):
self.viewmanager.handleEditCopy()
print "Pas de catalogue pour code %s, version %s" %(self.code,self.version_code)
sys.exit(0)
- # Determinination du repertoire materiau
- v_codeSansPoint=self.version_code
- v_codeSansPoint=re.sub("\.","",v_codeSansPoint)
- chaine="rep_mat_"+v_codeSansPoint
- if hasattr(self.appli.CONFIGURATION,chaine):
- a=getattr(self.appli.CONFIGURATION,chaine)
- else :
- try :
- a=self.appli.CONFIGURATION.dRepMat[self.version_code]
- except :
- if self.code == "ASTER" :
- print "Probleme avec le repertoire materiau"
- a='.'
- self.appli.CONFIGURATION.rep_mat=a
+ self.determineMater()
# détermination de fic_cata_c et fic_cata_p
self.appli.top.title(titre)
self.appli.titre=titre
+ def determineMater(self) :
+ # Determinination du repertoire materiau
+ v_codeSansPoint=self.version_code
+ v_codeSansPoint=re.sub("\.","",v_codeSansPoint)
+ chaine="rep_mat_"+v_codeSansPoint
+ if hasattr(self.appli.CONFIGURATION,chaine):
+ a=getattr(self.appli.CONFIGURATION,chaine)
+ else :
+ try :
+ a=self.appli.CONFIGURATION.dRepMat[self.version_code]
+ except :
+ if self.code == "ASTER" :
+ print "Probleme avec le repertoire materiau"
+ a='.'
+ self.appli.CONFIGURATION.rep_mat=a
+
def import_cata(self,cata):
"""
Réalise l'import du catalogue dont le chemin d'acca¨s est donné par cata
newWin = 0
for editor in self.editors:
if samepath(fn, editor.getFileName()):
- break
+ abort = QMessageBox.warning(self,
+ self.trUtf8("Fichier"),
+ self.trUtf8("Le fichier <b>%1</b> est deja ouvert.")
+ .arg(fn),
+ self.trUtf8("&Duplication"),
+ self.trUtf8("&Abort"), None, 1)
+ if abort:
+ break
else:
from editor import JDCEditor
editor = JDCEditor(fn, jdc, self,units=units)