From: Pascale Noyret Date: Wed, 26 Mar 2008 11:03:26 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V1_14a2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=96ce1b8a7ce83846dffa5aa5bc6dd5be89b35d4d;p=tools%2Feficas.git *** empty log message *** --- diff --git a/Editeur/configuration.py b/Editeur/configuration.py index a0c3f474..5036bc04 100644 --- a/Editeur/configuration.py +++ b/Editeur/configuration.py @@ -52,7 +52,6 @@ class CONFIGbase: self.lecture_catalogues_standard() self.lecture_fichier_ini_utilisateur() self.init_liste_param() - self.pref="style." #-------------------------------------- def lecture_fichier_ini_standard(self): @@ -260,8 +259,8 @@ class CONFIG(CONFIGbase): 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): @@ -309,6 +308,7 @@ class CONFIGStyle(CONFIGbase): self.YesNo={} self.l_param=[] CONFIGbase.__init__ (self,appli) + self.pref="style." def affichage_style_ini(self): self.affichage_fichier_ini() diff --git a/InterfaceQT/editor.py b/InterfaceQT/editor.py index b805e313..16df6961 100644 --- a/InterfaceQT/editor.py +++ b/InterfaceQT/editor.py @@ -1,4 +1,4 @@ -# -*- coding: iso-8859-1 -*- +#i -*- coding: iso-8859-1 -*- # Modules Python import types,sys,os @@ -18,7 +18,7 @@ import readercata import prefs import qtCommun -VERSION_EFICAS = "EFICAS v1.13" +VERSION_EFICAS = "EFICAS v1.14" # -------------------------- # @@ -59,7 +59,6 @@ class JDCEditor(QSplitter): if hasattr(qApp.mainWidget(),"statusBar"): self.sb = qApp.mainWidget().statusBar() - self.parent = parent self.vm = parent #viewManager self.fileName = fn self.fileInfo = None @@ -72,7 +71,7 @@ class JDCEditor(QSplitter): 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 @@ -677,6 +676,13 @@ class JDCEditor(QSplitter): 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) diff --git a/InterfaceQT/monUniqueBasePanel.py b/InterfaceQT/monUniqueBasePanel.py index e2bd9c59..1092d820 100644 --- a/InterfaceQT/monUniqueBasePanel.py +++ b/InterfaceQT/monUniqueBasePanel.py @@ -40,15 +40,24 @@ class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): 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) @@ -59,6 +68,7 @@ class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): 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", @@ -84,3 +94,21 @@ class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): 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)) + diff --git a/InterfaceQT/monUniqueSDCOIntoPanel.py b/InterfaceQT/monUniqueSDCOIntoPanel.py index ff80d41c..32120dd2 100644 --- a/InterfaceQT/monUniqueSDCOIntoPanel.py +++ b/InterfaceQT/monUniqueSDCOIntoPanel.py @@ -52,19 +52,6 @@ class MonUniqueSDCOIntoPanel(DUnSDCOInto,QTPanel,SaisieSDCO): 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): """ @@ -73,6 +60,7 @@ class MonUniqueSDCOIntoPanel(DUnSDCOInto,QTPanel,SaisieSDCO): - 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) @@ -95,6 +83,7 @@ class MonUniqueSDCOIntoPanel(DUnSDCOInto,QTPanel,SaisieSDCO): self.Commentaire.setText(commentaire) def LESDCOReturnPressed(self) : + self.LBSDCO.clearSelection() SaisieSDCO.LESDCOReturnPressed(self) def BOkPressed(self): diff --git a/InterfaceQT/qtCommun.py b/InterfaceQT/qtCommun.py index c5611d38..d9b3b4fa 100644 --- a/InterfaceQT/qtCommun.py +++ b/InterfaceQT/qtCommun.py @@ -203,6 +203,8 @@ class QTPanelTBW2(QTPanel): 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 diff --git a/InterfaceQT/qtEficas.py b/InterfaceQT/qtEficas.py index f387b47a..2b8b8e1e 100644 --- a/InterfaceQT/qtEficas.py +++ b/InterfaceQT/qtEficas.py @@ -22,7 +22,7 @@ class Appli(Eficas): """ Class implementing the main user interface. """ - def __init__(self,code="ASTER",salome=0): + def __init__(self,code="ASTER",salome=0,parent=None): """ Constructor @@ -32,10 +32,12 @@ class Appli(Eficas): 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 @@ -45,6 +47,12 @@ class Appli(Eficas): #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) @@ -76,6 +84,9 @@ class Appli(Eficas): self.initPatrons() self.monAssistant=QAssistantClient(QString(""), self.viewmanager) + if self.salome : + from Editeur import session + self.ouvreFichiers() def OPENTURNS(self) : self.MenuBar.removeItem(5) @@ -125,6 +136,11 @@ class Appli(Eficas): 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): """ @@ -201,7 +217,10 @@ class Appli(Eficas): def fileExit(self): self.viewmanager.handleCloseAll() - qApp.closeAllWindows() + if self.salome : + self.close() + else : + qApp.closeAllWindows() def editCopy(self): self.viewmanager.handleEditCopy() diff --git a/InterfaceQT/readercata.py b/InterfaceQT/readercata.py index d2d40fbc..2f37094d 100644 --- a/InterfaceQT/readercata.py +++ b/InterfaceQT/readercata.py @@ -106,20 +106,7 @@ class READERCATA: 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 @@ -180,6 +167,22 @@ class READERCATA: 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 diff --git a/InterfaceQT/viewManager.py b/InterfaceQT/viewManager.py index 21bdf14f..9ae8bda0 100644 --- a/InterfaceQT/viewManager.py +++ b/InterfaceQT/viewManager.py @@ -927,7 +927,14 @@ class ViewManager: newWin = 0 for editor in self.editors: if samepath(fn, editor.getFileName()): - break + abort = QMessageBox.warning(self, + self.trUtf8("Fichier"), + self.trUtf8("Le fichier %1 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) diff --git a/Ui/image120.gif b/Ui/image120.gif new file mode 100644 index 00000000..1834870b Binary files /dev/null and b/Ui/image120.gif differ diff --git a/Ui/image120.png b/Ui/image120.png new file mode 100644 index 00000000..264a9700 Binary files /dev/null and b/Ui/image120.png differ diff --git a/Ui/image240.gif b/Ui/image240.gif new file mode 100644 index 00000000..2ed58745 Binary files /dev/null and b/Ui/image240.gif differ