From: Pascale Noyret Date: Tue, 29 Jul 2008 13:56:08 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V1_14QT4v1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e2eba136278b1090181dda05954f05456f6d7be;p=tools%2Feficas.git *** empty log message *** --- diff --git a/InterfaceQT4/monChoixCata.py b/InterfaceQT4/monChoixCata.py index 714563b7..1aa368bb 100644 --- a/InterfaceQT4/monChoixCata.py +++ b/InterfaceQT4/monChoixCata.py @@ -22,7 +22,8 @@ # Modules Eficas from desChoixCata import Ui_DChoixCata -from PyQt4 import * +from PyQt4 import * +from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtCore import * diff --git a/InterfaceQT4/monFonctionPanel.py b/InterfaceQT4/monFonctionPanel.py index 45b40e04..0a42222b 100644 --- a/InterfaceQT4/monFonctionPanel.py +++ b/InterfaceQT4/monFonctionPanel.py @@ -20,13 +20,14 @@ # ====================================================================== # Modules Python import string,types,os -from PyQt4 import * -from PyQt4.QtGui import * # Modules Eficas from qtSaisie import SaisieValeur from monPlusieursBasePanel import MonPlusieursBasePanel +from PyQt4.QtGui import * +from PyQt4.QtCore import * + # Import des panels class MonFonctionPanel(MonPlusieursBasePanel): @@ -67,7 +68,7 @@ class MonFonctionPanel(MonPlusieursBasePanel): self.LBValeurs.clear() listeValeurs=self.node.item.GetListeValeurs() for valeur in self.DecoupeListeValeurs(listeValeurs): - self.LBValeurs.insertItem(str(valeur)) + self.LBValeurs.addItem(str(valeur)) def Ajout1Valeur(self,liste=[]): # Pour être appele a partir du Panel Importer (donc plusieurs fois par AjouterNValeur) diff --git a/InterfaceQT4/monIncludePanel.py b/InterfaceQT4/monIncludePanel.py index d01d0397..054a757d 100644 --- a/InterfaceQT4/monIncludePanel.py +++ b/InterfaceQT4/monIncludePanel.py @@ -22,9 +22,9 @@ # Modules Eficas import os,traceback,sys -from PyQt4 import * +#from PyQt4 import * from PyQt4.QtGui import * -from desMacro import DMacro +#from monMacroPanel import DMacro from monMacroPanel import MonMacroPanel import convert @@ -48,7 +48,8 @@ class MonIncludePanel(MonMacroPanel): self.ajoutPageOk() def ajoutPageOk(self): - self.TabPage = QWidget(self.TWChoix,"TabPage") + self.TabPage = QWidget(self.TWChoix) + self.TabPage.setObjectName("TabPage") self.LENomFichier = QLineEdit(self.TabPage,"LENomFichier") self.LENomFichier.setGeometry(QRect(18,127,450,30)) self.textLabel1_3 = QLabel(self.TabPage,"textLabel1_3") @@ -78,7 +79,7 @@ class MonIncludePanel(MonMacroPanel): def ajoutPageBad(self) : - self.TabPage = QWidget(self.TWChoix,"TabPage") + self.TabPage = QWidget(self.TWChoix) self.textLabel1_5 = QLabel(self.TabPage,"textLabel1_5") TabPageLayout = QGridLayout(self.TabPage,1,1,11,6,"TabPageLayout") TabPageLayout.addWidget(self.textLabel1_5,0,0) diff --git a/InterfaceQT4/monMCFactPanel.py b/InterfaceQT4/monMCFactPanel.py index 0fb9bea2..c5b61ea3 100644 --- a/InterfaceQT4/monMCFactPanel.py +++ b/InterfaceQT4/monMCFactPanel.py @@ -43,7 +43,7 @@ class MonMCFactPanel(DMCFact,QTPanelTBW1): discrètes """ def __init__(self,node, parent = None,name = None,fl = 0): - DMCFact.__init__(self,parent,name,fl) + DMCFact.__init__(self,parent,fl) QTPanel.__init__(self,node,parent) QTPanelTBW1.__init__(self,node,parent) self.connecterSignaux() diff --git a/InterfaceQT4/monPlusieursASSDPanel.py b/InterfaceQT4/monPlusieursASSDPanel.py index dd099c22..c01c8600 100644 --- a/InterfaceQT4/monPlusieursASSDPanel.py +++ b/InterfaceQT4/monPlusieursASSDPanel.py @@ -27,7 +27,7 @@ import prefs from PyQt4 import * from PyQt4.QtGui import * from monPlusieursIntoPanel import MonPlusieursIntoPanel -from desPlusieursInto import DPlusInto +from monPlusieursIntoPanel import DPlusInto from qtCommun import QTPanel from politiquesValidation import PolitiquePlusieurs # Import des panels @@ -40,7 +40,7 @@ class MonPlusieursASSDPanel(MonPlusieursIntoPanel): """ def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) - DPlusInto.__init__(self,parent,name,fl) + DPlusInto.__init__(self,parent,fl) self.listeValeursCourantes=self.node.item.GetListeValeurs() self.InitValeursCourantes() @@ -55,14 +55,14 @@ class MonPlusieursASSDPanel(MonPlusieursIntoPanel): listeNomsSD = self.node.item.get_sd_avant_du_bon_type() self.listBoxVal.clear() for aSD in listeNomsSD: - self.listBoxVal.insertItem( aSD) + self.listBoxVal.addItem( aSD) if len(listeNomsSD) == 1 : - self.listBoxVal.setSelected(0,1) + self.listBoxVal.setCurrentRow(1) def DisplayListBoxCourantes(self): self.LBValeurs.clear() for aSD in self.listNomsValeurs : - self.LBValeurs.insertItem( aSD) + self.LBValeurs.addItem( aSD) def InitValeursCourantes(self): self.listNomsValeurs=[] @@ -111,9 +111,11 @@ class MonPlusieursASSDPanel(MonPlusieursIntoPanel): l1=self.listeValeursCourantes[:index] l3=self.listeValeursCourantes[index:] for valeur in listeRetour: - self.LBValeurs.insertItem(QString(str(valeur)),index) + self.LBValeurs.addItem(QString(str(valeur)),index) index=index+1 self.listeValeursCourantes=l1+listeRetour+l3 self.InitValeursCourantes() self.DisplayListBoxCourantes() self.DisplayListBoxPossibles() + + diff --git a/InterfaceQT4/monPlusieursBasePanel.py b/InterfaceQT4/monPlusieursBasePanel.py index f4f9977f..ebb3c778 100644 --- a/InterfaceQT4/monPlusieursBasePanel.py +++ b/InterfaceQT4/monPlusieursBasePanel.py @@ -22,16 +22,20 @@ import string,types,os # Modules Eficas -import prefs - -from PyQt4 import * from PyQt4.QtGui import * +from PyQt4.QtCore import * -from desPlusieursBase import DPlusBase +from desPlusieursBase import Ui_DPlusBase from qtCommun import QTPanel from qtSaisie import SaisieValeur from politiquesValidation import PolitiquePlusieurs +class DPlusBase (Ui_DPlusBase,QDialog): + def __init__(self,parent ,modal ) : + QDialog.__init__(self,parent) + self.setupUi(self) + self.setModal(modal) + # Import des panels class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): @@ -42,12 +46,25 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): """ def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) - DPlusBase.__init__(self,parent,name,fl) + DPlusBase.__init__(self,parent,fl) self.politique=PolitiquePlusieurs(node,parent) self.BuildLBValeurs() self.listeValeursCourantes=self.node.item.GetListeValeurs() self.InitCommentaire() self.detruitBouton() + self.connecterSignaux() + + def connecterSignaux(self) : + self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPourListePressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.bParam,SIGNAL("clicked()"),self.BParametresPressed) + self.connect(self.bImport,SIGNAL("clicked()"),self.BImportPressed) + self.connect(self.BAjout1Val,SIGNAL("clicked()"),self.Ajout1Valeur) + self.connect(self.BSup1Val,SIGNAL("clicked()"),self.Sup1Valeur) + self.connect(self.LEValeur,SIGNAL("returnPressed()"),self.LEValeurPressed) + self.connect(self.BSalome,SIGNAL("clicked()"),self.BSalomePressed) + self.connect(self.BView2D,SIGNAL("clicked()"),self.BView2DPressed) def detruitBouton(self): mc = self.node.item.get_definition() @@ -116,7 +133,10 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): def BImportPressed(self): init=QString( self.editor.CONFIGURATION.rep_user) - fn = QFileDialog.getOpenFileName(init, self.trUtf8('All Files (*)',)) + fn = QFileDialog.getOpenFileName(self.node.appliEficas, + self.node.appliEficas.trUtf8('Fichier de données'), + QString(), + self.trUtf8('All Files (*)',)) if fn == None : return if fn == "" : return from monSelectVal import MonSelectVal diff --git a/InterfaceQT4/monPlusieursIntoPanel.py b/InterfaceQT4/monPlusieursIntoPanel.py index e76fedf4..3d0210a2 100644 --- a/InterfaceQT4/monPlusieursIntoPanel.py +++ b/InterfaceQT4/monPlusieursIntoPanel.py @@ -22,17 +22,19 @@ import string,types,os # Modules Eficas -import prefs - -from PyQt4 import * from PyQt4.QtGui import * +from PyQt4.QtCore import * -from desPlusieursInto import DPlusInto +from desPlusieursInto import Ui_DPlusInto from qtCommun import QTPanel from qtSaisie import SaisieValeur from politiquesValidation import PolitiquePlusieurs -# Import des panels +class DPlusInto(Ui_DPlusInto,QDialog): + def __init__(self,parent ,modal ) : + QDialog.__init__(self,parent) + self.setupUi(self) + self.setModal(modal) class MonPlusieursIntoPanel(DPlusInto,QTPanel,SaisieValeur): """ @@ -42,14 +44,23 @@ class MonPlusieursIntoPanel(DPlusInto,QTPanel,SaisieValeur): """ def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) - DPlusInto.__init__(self,parent,name,fl) + DPlusInto.__init__(self,parent,fl) self.politique=PolitiquePlusieurs(node,parent) SaisieValeur.BuildLBValeurs(self) self.listeValeursCourantes=self.node.item.GetListeValeurs() SaisieValeur.RemplitPanel(self,self.listeValeursCourantes) - QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.Ajout1Valeur ) self.InitCommentaire() + def connecterSignaux(self) : + self.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.Ajout1Valeur ) + self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPourListePressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.LBValeurs,SIGNAL("doubleClicked(QListBoxItem*)"),self.Sup1Valeur) + self.connect(self.BAjout1Val,SIGNAL("clicked()"),self.Ajout1Valeur) + self.connect(self.BSup1Val,SIGNAL("clicked()"),self.Sup1Valeur) + + def BOkPourListePressed(self): if self.listeValeursCourantes == [] : self.editor.affiche_infos("Pas de validation d un groupe vide") diff --git a/InterfaceQT4/monRacinePanel.py b/InterfaceQT4/monRacinePanel.py index 8ebc8e5f..2f6e6e36 100644 --- a/InterfaceQT4/monRacinePanel.py +++ b/InterfaceQT4/monRacinePanel.py @@ -29,11 +29,14 @@ from PyQt4 import * from PyQt4.QtGui import * from PyQt4.QtCore import * -class DRac(Ui_DRac,QDialog): +class DRac(Ui_DRac,QWidget): def __init__(self,parent ,modal = 0 ) : - QDialog.__init__(self,parent) + print parent + print parent.__class__ + print parent.QWParent + print dir(parent.QWParent) + QWidget.__init__(self,parent.QWParent) self.setupUi(self) - self.setModal(modal) # Import des panels diff --git a/InterfaceQT4/monSelectVal.py b/InterfaceQT4/monSelectVal.py index 09e0d6a5..b42e7669 100644 --- a/InterfaceQT4/monSelectVal.py +++ b/InterfaceQT4/monSelectVal.py @@ -22,12 +22,16 @@ # Modules Eficas from desSelectVal import Ui_DSelVal -from PyQt4 import * from PyQt4.QtGui import * +from PyQt4.QtCore import * -# Import des panels +class DSelVal(Ui_DSelVal,QDialog): + def __init__(self,parent ,modal ) : + QDialog.__init__(self,parent) + self.setupUi(self) + self.setModal(modal) -class MonSelectVal(Ui_DSelVal): +class MonSelectVal(DSelVal): """ Classe définissant le panel associé aux mots-clés qui demandent à l'utilisateur de choisir une seule valeur parmi une liste de valeurs @@ -35,7 +39,7 @@ class MonSelectVal(Ui_DSelVal): """ def __init__(self,file,parent,name = None,fl = 0): self.FonctPanel=parent - Ui_DSelVal.__init__(self,parent,name,Qt.WType_Dialog) + DSelVal.__init__(self,parent,0) self.dictSepar={} self.separateur=" " self.texte=" " @@ -43,6 +47,12 @@ class MonSelectVal(Ui_DSelVal): self.file=str(file) self.readVal() self.initVal() + self.connecterSignaux() + + def connecterSignaux(self) : + self.connect(self.BGSeparateur,SIGNAL("clicked(int)"),self.SeparateurSelect) + self.connect(self.BImportSel,SIGNAL("clicked()"),self.BImportSelPressed) + self.connect(self.BImportTout,SIGNAL("clicked()"),self.BImportToutPressed) def readVal(self): f = open(self.file, "rb") @@ -56,16 +66,16 @@ class MonSelectVal(Ui_DSelVal): self.dictSepar["point-virgule"]=";" self.dictSepar["espace"]=" " - def on_BGSeparateur_clicked(self,numero): + def SeparateurSelect(self,numero): monBouton=self.BGSeparateur.find(numero) self.separateur=self.dictSepar[str(monBouton.text())] - def on_BImportSel_clicked(self): + def BImportSelPressed(self): text=str(self.TBtext.selectedText()) self.textTraite=text self.Traitement() - def on_BImportTout_clicked(self): + def BImportToutPressed(self): self.textTraite=self.texte self.Traitement() diff --git a/InterfaceQT4/monUniqueCompPanel.py b/InterfaceQT4/monUniqueCompPanel.py index cb35947f..62e7d39b 100644 --- a/InterfaceQT4/monUniqueCompPanel.py +++ b/InterfaceQT4/monUniqueCompPanel.py @@ -22,18 +22,22 @@ import string,types,os,re # Modules Eficas -import prefs - -from PyQt4 import * +from PyQt4.QtCore import * from PyQt4.QtGui import * -from desUniqueComp import DUnComp +from desUniqueComp import Ui_DUnComp from qtCommun import QTPanel from politiquesValidation import PolitiqueUnique +class DUnComp(Ui_DUnComp,QDialog): + def __init__(self,parent ,modal ) : + QDialog.__init__(self,parent) + self.setupUi(self) + self.setModal(modal) + + # Import des panels -#class MonUniqueCompPanel(DUnComp,QTPanel,SaisieValeur): class MonUniqueCompPanel(DUnComp,QTPanel,PolitiqueUnique): """ Classe définissant le panel associé aux mots-clés qui demandent @@ -42,10 +46,20 @@ class MonUniqueCompPanel(DUnComp,QTPanel,PolitiqueUnique): """ def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) - DUnComp.__init__(self,parent,name,fl) + DUnComp.__init__(self,parent,fl) self.politique=PolitiqueUnique(node,parent) self.InitLinesVal() self.InitCommentaire() + self.connecterSignaux() + + def connecterSignaux(self): + self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.LEImag,SIGNAL("returnPressed()"),self.LEImagRPressed) + self.connect(self.LEReel,SIGNAL("returnPressed()"),self.LEReelRPressed) + self.connect(self.LEcomp,SIGNAL("returnPressed()"),self.LEcompRPressed) + def InitLinesVal(self): valeur=self.node.item.get_valeur() @@ -57,9 +71,9 @@ class MonUniqueCompPanel(DUnComp,QTPanel,PolitiqueUnique): self.LEReel.setText(str(x1)) self.LEImag.setText(str(x2)) if typ_cplx == "RI" : - self.buttonGroup1.setButton(1) + self.RBRI.setDown(1) else : - self.buttonGroup1.setButton(0) + self.RBMP.setDown(1) def LEcompRPressed(self) : diff --git a/InterfaceQT4/monUniqueIntoPanel.py b/InterfaceQT4/monUniqueIntoPanel.py index ff991aae..ce24e4ba 100644 --- a/InterfaceQT4/monUniqueIntoPanel.py +++ b/InterfaceQT4/monUniqueIntoPanel.py @@ -22,17 +22,20 @@ import string,types,os # Modules Eficas -import prefs - -from PyQt4 import * from PyQt4.QtGui import * +from PyQt4.QtCore import * -from desUniqueInto import DUnIn +from desUniqueInto import Ui_DUnIn from qtCommun import QTPanel from qtSaisie import SaisieValeur from politiquesValidation import PolitiqueUnique -# Import des panels +class DUnIn(Ui_DUnIn,QDialog): + def __init__(self,parent ,modal ) : + QDialog.__init__(self,parent) + self.setupUi(self) + self.setModal(modal) + class MonUniqueIntoPanel(DUnIn,QTPanel,SaisieValeur): """ @@ -42,10 +45,16 @@ class MonUniqueIntoPanel(DUnIn,QTPanel,SaisieValeur): """ def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) - DUnIn.__init__(self,parent,name,fl) + DUnIn.__init__(self,parent,fl) SaisieValeur.RemplitPanel(self) self.politique=PolitiqueUnique(node,parent) - QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.ClicValeur ) + self.connecterSignaux() + + def connecterSignaux(self) : + self.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.ClicValeur ) + self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) def ClicValeur(self): SaisieValeur.ClicValeur(self) diff --git a/InterfaceQT4/monUniqueSDCOPanel.py b/InterfaceQT4/monUniqueSDCOPanel.py index 15e6a33d..9f82da16 100644 --- a/InterfaceQT4/monUniqueSDCOPanel.py +++ b/InterfaceQT4/monUniqueSDCOPanel.py @@ -22,15 +22,19 @@ import string,types,os # Modules Eficas -import prefs +from PyQt4.QtCore import * +from PyQt4.QtGui import * -from PyQt4 import * -from PyQt4.QtGui import * - -from desUniqueSDCO import DUnSDCO +from desUniqueSDCO import Ui_DUnSDCO from qtCommun import QTPanel from qtSaisie import SaisieSDCO +class DUnSDCO(Ui_DUnSDCO,QDialog): + def __init__(self,parent ,modal ) : + QDialog.__init__(self,parent) + self.setupUi(self) + self.setModal(modal) + # Import des panels class MonUniqueSDCOPanel(DUnSDCO,QTPanel,SaisieSDCO): @@ -41,10 +45,19 @@ class MonUniqueSDCOPanel(DUnSDCO,QTPanel,SaisieSDCO): """ def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) - DUnSDCO.__init__(self,parent,name,fl) + DUnSDCO.__init__(self,parent,fl) valeur = self.node.item.get_valeur() if valeur != "" and valeur != None : self.LESDCO.setText(QString(valeur.nom)) + self.connecterSignaux() + + def connecterSignaux(self) : + self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.LESDCO,SIGNAL("returnPressed()"),self.LESDCOReturnPressed) + + def BOkPressed(self): SaisieSDCO.LESDCOReturnPressed(self) diff --git a/InterfaceQT4/qtSaisie.py b/InterfaceQT4/qtSaisie.py index b1b45acb..ad7cdcf1 100644 --- a/InterfaceQT4/qtSaisie.py +++ b/InterfaceQT4/qtSaisie.py @@ -62,7 +62,7 @@ class SaisieValeur: for valeur in lChoix : self.listBoxVal.addItem( str(valeur) ) if len(lChoix) == 1 : - self.listBoxVal.setSelected(0,1) + self.listBoxVal.setCurrentRow(1) def ClicASSD(self): if self.listBoxASSD.selectedItem()== None : return diff --git a/InterfaceQT4/viewManager.py b/InterfaceQT4/viewManager.py index 6ee892f0..b8be765c 100644 --- a/InterfaceQT4/viewManager.py +++ b/InterfaceQT4/viewManager.py @@ -34,7 +34,9 @@ class MyTabview: self.dict_editors={} self.untitledCount = 0 + self.gridLayout = QGridLayout(self.appliEficas.centralWidget()) self.myQtab = QTabWidget(self.appliEficas.centralWidget()) + self.gridLayout.addWidget(self.myQtab) #self.connect(tw, SIGNAL('currentChanged(QWidget*)'), self.handleCurrentChanged) @@ -130,9 +132,9 @@ class MyTabview: else: editor.closeIt() - hauteur=self.appliEficas.centralWidget().height() - largeur=self.appliEficas.centralWidget().width() - self.myQtab.setGeometry(0,0,hauteur,largeur) + #hauteur=self.appliEficas.centralWidget().height() + #argeur=self.appliEficas.centralWidget().width() + #self.myQtab.setGeometry(0,0,hauteur,largeur) if newWin: self.addView(editor, fichier) elif editor.jdc: