From ebbaa6b57c5a4bb84dd668774427df4d9bf34d26 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Tue, 25 Mar 2008 13:14:56 +0000 Subject: [PATCH] *** empty log message *** --- InterfaceQT/compomacro.py | 6 +++--- InterfaceQT/compooper.py | 11 +++++++---- InterfaceQT/composimp.py | 22 --------------------- InterfaceQT/monIncludePanel.py | 19 +++++++++++++++++- InterfaceQT/monPlusieursBasePanel.py | 29 +++++++++++++++++++++++++++- InterfaceQT/qtCommun.py | 4 +++- InterfaceQT/viewManager.py | 1 + 7 files changed, 60 insertions(+), 32 deletions(-) diff --git a/InterfaceQT/compomacro.py b/InterfaceQT/compomacro.py index 989399c6..74e2f59a 100644 --- a/InterfaceQT/compomacro.py +++ b/InterfaceQT/compomacro.py @@ -100,9 +100,9 @@ class POURSUITETreeItem(INCLUDETreeItemBase): itemNode=POURSUITENode -# ------------------------------------ -# Classes necessaires à POURSUITE -# ------------------------------------ +# ---------------------------------------- +# Classes necessaires à INCLUDE MATERIAU +# ---------------------------------------- class MATERIAUNode(MACRONode): diff --git a/InterfaceQT/compooper.py b/InterfaceQT/compooper.py index c638e950..54f6061e 100644 --- a/InterfaceQT/compooper.py +++ b/InterfaceQT/compooper.py @@ -18,6 +18,8 @@ class Node(browser.JDCNode, typeNode.PopUpMenuNode): def createPopUpMenu(self): typeNode.PopUpMenuNode.createPopUpMenu(self) + if ("AFFE_CARA_ELEM" in self.item.get_genealogie()) and self.editor.salome: + self.menu.insertItem( 'View3D', self.view3D ) def doPaste(self,node_selected): """ @@ -47,6 +49,11 @@ class Node(browser.JDCNode, typeNode.PopUpMenuNode): child = self.append_child(objet_a_copier,pos='first',retour='oui') return child + def view3D(self) : + import TroisDPal + troisD=TroisDPal.TroisDPilote(self.item,self.editor.parent.appliEficas) + troisD.envoievisu() + class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): """ La classe EtapeTreeItem est un adaptateur des objets ETAPE du noyau @@ -239,10 +246,6 @@ class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): return commande_comment - def visu_3D(self,appli,node) : - import TroisDPal - troisD=TroisDPal.TroisDPilote(node.item,appli,node.parent) - troisD.envoievisu() import Accas treeitem = EtapeTreeItem diff --git a/InterfaceQT/composimp.py b/InterfaceQT/composimp.py index 257507d4..8a0c4a96 100644 --- a/InterfaceQT/composimp.py +++ b/InterfaceQT/composimp.py @@ -87,30 +87,8 @@ class Node(browser.JDCNode): from monFonctionPanel import MonFonctionPanel klass = MonFonctionPanel - #--------------------------------------------------------- - # PN ajout pour lancement de Salome - #--------------------------------------------------------- - if self.editor.salome != 0 : -## import panelsSalome -## -## self.item.select_noeud_maille=0 -## self.item.clef_fonction="SALOME" -## for i in range(0,len( genea )) : -## self.item.clef_fonction=self.item.clef_fonction+"_"+ genea[i] -## #if genea[i] == "GROUP_NO" or genea[i] == "GROUP_MA": -## if "GROUP_NO" in genea[len(genea)-1] or "GROUP_MA" in genea[len(genea)-1]: -## self.item.select_noeud_maille=1 -## -## recherche=panelsSalome.dict_classes_salome[klass] -## if hasattr(recherche,self.item.clef_fonction): -## klass=recherche -## if self.item.select_noeud_maille==1 : -## klass=recherche - klass = None #CS_pbruno todo - if not klass: return None - return klass( self, self.editor ) diff --git a/InterfaceQT/monIncludePanel.py b/InterfaceQT/monIncludePanel.py index 3c1eba09..b2e925bd 100644 --- a/InterfaceQT/monIncludePanel.py +++ b/InterfaceQT/monIncludePanel.py @@ -63,11 +63,16 @@ class MonIncludePanel(MonMacroPanel): self.LENomFichier.setText(self.node.item.object.fichier_ini) else : self.LENomFichier.setText("") + self.LENomFichier.setText(self.node.item.object.fichier_ini) - self.LENomFichier.setText(self.node.item.object.fichier_ini) + self.BChangeFile = QPushButton(self.TabPage,"BChangeFile") + self.BChangeFile.setGeometry(QRect(290,350,161,41)) + self.BChangeFile.setSizePolicy(QSizePolicy(0,0,0,0,self.BChangeFile.sizePolicy().hasHeightForWidth())) + self.BChangeFile.setText(self._DMacro__tr("Autre Fichier")) self.connect(self.BBrowse,SIGNAL("clicked()"),self.BBrowsePressed) + self.connect(self.BChangeFile,SIGNAL("clicked()"),self.BChangeFilePressed) self.connect(self.LENomFichier,SIGNAL("returnPressed()"),self.LENomFichReturnPressed) @@ -135,3 +140,15 @@ class MonIncludePanel(MonMacroPanel): self.editor.affiche_infos(commentaire) return text + + def BChangeFilePressed(self): + userDir=os.path.expanduser("~/Eficas_install/") + fn = QFileDialog.getOpenFileName(userDir, + self.trUtf8('All Files (*);;''JDC Files (*.comm);;'), self.editor) + + if fn.isNull(): + return + + fn = os.path.abspath((unicode(fn))) + self.LENomFichier.setText(fn) + self.LENomFichReturnPressed() diff --git a/InterfaceQT/monPlusieursBasePanel.py b/InterfaceQT/monPlusieursBasePanel.py index fea6cb71..9f038dc8 100644 --- a/InterfaceQT/monPlusieursBasePanel.py +++ b/InterfaceQT/monPlusieursBasePanel.py @@ -46,9 +46,16 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): self.BuildLBValeurs() self.listeValeursCourantes=self.node.item.GetListeValeurs() self.InitCommentaire() + self.detruitBouton() + + def detruitBouton(self): + mc = self.node.item.get_definition() + type = mc.type[0] + if not('grma' in repr(type)) or not(self.editor.salome) : + self.BSalome.close() def ViewDoc(self): - QTPanel.ViewDoc(self) + QTPanel.ViewDoc(self) def BuildLBValeurs(self): # redefinit en raison de l heritage par monFonctionPanel @@ -134,3 +141,23 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): commentaire=commentaire + "\n" + aideval self.Commentaire.setText(QString(commentaire)) + 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" + + print "BkwType",kwType + print "editor", self.editor + 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/qtCommun.py b/InterfaceQT/qtCommun.py index e94ccf6b..c5611d38 100644 --- a/InterfaceQT/qtCommun.py +++ b/InterfaceQT/qtCommun.py @@ -200,9 +200,11 @@ class QTPanelTBW2(QTPanel): self.LBNouvCommande.insertItem( aCmd) self.LBNouvCommande.insertItem( " " ) QObject.connect( self.LBNouvCommande, SIGNAL("doubleClicked(QListBoxItem*)"),self.DefCmd ) - QObject.connect( self.LBNouvCommande, SIGNAL("clicked(QListBoxItem*)"),self.DefCmd ) + QObject.connect( self.LBNouvCommande, SIGNAL("returnPressed(QListBoxItem*)"),self.DefCmd ) def DefCmd(self): + if (self.editor.focusWidget())!=self.LBNouvCommande : + return if self.LBNouvCommande.selectedItem()== 0 : return if self.LBNouvCommande.selectedItem()== None : return name=str(self.LBNouvCommande.selectedItem().text()) diff --git a/InterfaceQT/viewManager.py b/InterfaceQT/viewManager.py index 55bbde77..21bdf14f 100644 --- a/InterfaceQT/viewManager.py +++ b/InterfaceQT/viewManager.py @@ -90,6 +90,7 @@ class ViewManager: """ # initialize the instance variables self.ui = ui + self.appliEficas = ui self.editors = [] self.currentEditor = None self.untitledCount = 0 -- 2.39.2