- def __init__(self,editor, name = None,fl = 0):
- self.editor=editor
- QDialog.__init__(self,editor)
- self.setupUi(self)
- self.connecterSignaux()
- self.dejaExistant=0
- self.listeTousParam=self.editor.jdc.params
- self.dictListe={}
- self.initToutesVal()
-
- def connecterSignaux(self) :
- self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.lineEditValReturnPressed)
- self.connect(self.lineEditNom,SIGNAL("returnPressed()"),self.lineEditNomReturnPressed)
-
-
- def CreeParametre(self):
- nom=str(self.lineEditNom.text())
- val=str(self.lineEditVal.text())
- if val == "" or None : return
- if nom == "" or None : return
- print self.editor.tree
- if len(self.editor.tree.selectedItems()) == 0 :
- itemAvant=self.editor.tree.racine
- param=itemAvant.addParameters(True)
- else :
- itemAvant=self.editor.tree.selectedItems()[0]
- param=itemAvant.addParameters(False)
- param.item.set_nom(nom)
- param.item.set_valeur(val)
- param.update_node_texte()
-
-
- def lineEditValReturnPressed(self):
- qtVal=self.lineEditVal.text()
+ def __init__(self,node,editor,commentaire):
+ QWidget.__init__(self,None)
+ self.node=node
+ self.node.fenetre=self
+ self.setupUi(self)
+ self.editor=editor
+ self.appliEficas=self.editor.appliEficas
+ self.repIcon=self.appliEficas.repIcon
+
+ self.setIconePoubelle()
+ self.remplit()
+ if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close()
+ else : self.connect(self.bCatalogue,SIGNAL("clicked()"), self.afficheCatalogue)
+ self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.LEValeurPressed)
+ self.connect(self.lineEditNom,SIGNAL("returnPressed()"),self.LENomPressed)
+ self.connect(self.bAvant,SIGNAL("clicked()"), self.afficheAvant)
+ self.connect(self.bApres,SIGNAL("clicked()"), self.afficheApres)
+ self.connect(self.bVerifie,SIGNAL("clicked()"), self.verifiePressed)
+ self.editor.affiche_infos("")
+ if self.editor.widgetOptionnel!= None :
+ self.editor.widgetOptionnel.close()
+ self.editor.widgetOptionnel=None
+
+
+
+
+ def afficheCatalogue(self):
+ self.node.tree.racine.affichePanneau()
+ if self.node : self.node.select()
+ else : self.node.tree.racine.select()
+
+ def remplit(self):
+ nom=self.node.item.get_nom()
+ self.lineEditNom.setText(nom)
+
+ valeur=self.node.item.get_valeur()
+ if valeur == None :
+ self.lineEditVal.clear()
+ elif type(valeur) == types.ListType :
+ texte="["
+ for l in valeur :
+ texte=texte+str(l) +","
+ texte=texte[0:-1]+"]"
+ self.lineEditVal.setText(texte)
+ else :
+ self.lineEditVal.setText(str(valeur))
+
+
+ def donnePremier(self):
+ self.lineEditVal.setFocus(7)
+
+ def LEValeurPressed(self):
+ if self.verifiePressed() == False :
+ QMessageBox.warning( self,tr( "Modification Impossible"),tr( "le parametre n'est pas valide"))
+ nom=str(self.lineEditNom.text())
+ val=str(self.lineEditVal.text())
+ self.node.item.set_nom(nom)
+ self.node.item.set_valeur(val)
+ self.node.update_texte()
+ self.node.update_node_valid()
+
+ def LENomPressed(self):
+ self.LEValeurPressed()
+
+ def verifiePressed(self):
+ nomString=str(self.lineEditNom.text())
+ if not pattern_name.match(nomString) :
+ self.LECommentaire.setText(nomString + tr(" n est pas un identifiant correct"))
+ return False
+