self.node = node
self.editor = editor
self.jdc = self.item.object.get_jdc_root()
- if self.editor.widgetTree != None:
- self.connect(self.bFormulaire,SIGNAL("clicked()"),self.bFormulaireReturnPressed)
- else :
- self.bFormulaire.close()
debutTitre=self.editor.titre
self.listeWidget=[]
if self.editor.fichier != None :
else :
nouveauTitre=debutTitre
self.editor.appliEficas.setWindowTitle(nouveauTitre)
+
+
self.connect(self.RBalpha,SIGNAL("clicked()"),self.afficheAlpha)
self.connect(self.RBGroupe,SIGNAL("clicked()"),self.afficheGroupe)
+ self.connect(self.RBOrdre,SIGNAL("clicked()"),self.afficheOrdre)
+
+ if self.editor.Ordre_Des_Commandes == None : self.RBOrdre.close()
+
+
self.editor.labelCommentaire.setText("")
- self.affiche_alpha=self.editor.affiche_alpha
self.name=None
- self.AjouteRadioButton()
self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.AjouteRadioButton)
+ self.affiche_alpha=0
+ self.affiche_groupe=0
+ self.affiche_ordre=0
+ if self.editor.affiche=="alpha" :
+ self.affiche_alpha==1;
+ self.RBalpha.setChecked(True);
+ self.afficheAlpha()
+ elif self.editor.affiche=="groupe" :
+ self.affiche_groupe==1;
+ self.RBGroupe.setChecked(True);
+ self.afficheGroupe()
+ elif self.editor.affiche=="ordre" :
+ self.affiche_ordre==1;
+ self.RBOrdre.setChecked(True);
+ self.afficheOrdre()
+
def afficheAlpha(self):
self.affiche_alpha=1
- self.editor.affiche_alpha=1
+ self.affiche_groupe=0
+ self.affiche_ordre=0
self.AjouteRadioButton()
def afficheGroupe(self):
self.affiche_alpha=0
- self.editor.affiche_alpha=0
+ self.affiche_groupe=1
+ self.affiche_ordre=0
self.AjouteRadioButton()
- def bFormulaireReturnPressed(self):
- print "PNPNPNPN a Programmer"
- self.connect(self.bFormulaire,SIGNAL("clicked()"),self.bFormulaireReturnPressed)
+ def afficheOrdre(self):
+ self.affiche_alpha=0
+ self.affiche_groupe=0
+ self.affiche_ordre=1
+ self.AjouteRadioButton()
def mouseDoubleClickEvent(self,event):
nodeCourrant=self.node.tree.currentItem()
if nodeCourrant==None: nodeCourrant=self.node.tree.racine
if self.name != None :
- if nodeCourrant==self.node : self.node.append_child(self.name,'first')
- else : nodeCourrant.append_brother(self.name)
+ plier=self.editor.afficheCommandesPliees
+ if nodeCourrant==self.node : nouveau=self.node.append_child(self.name,'first',plier)
+ else : nouveau=nodeCourrant.append_brother(self.name,plier=plier)
+ if nouveau == 0 : return # on n a pas insere le noeud
+ nouveau.setDeplie()
+ #if self.editor.afficheApresInsert==True : nouveau.plieToutEtReaffiche()
+ if self.editor.afficheApresInsert == True :
+ #if self.editor.affichePlie==True: nouveau.plieToutEtReaffiche()
+ if self.editor.afficheCommandesPliees ==True: nouveau.plieToutEtReaffiche()
+ else : nouveau.deplieToutEtReaffiche()
+ nouveau.fenetre.donnePremier()
+ #nouveau.deplieToutEtReaffiche()
+ else :
+ self.node.setSelected(False)
+ nouveau.setSelected(True)
+ self.node.tree.setCurrentItem(nouveau)
+ event.accept()
+
def CreeListeCommande(self,filtre):
listeGroupes,dictGroupes=self.jdc.get_groups()
if self.affiche_alpha==1 :
liste=self.CreeListeCommande(filtre)
for cmd in liste :
-#PNPNPN Possibilite de tr ?
- rbcmd=(QRadioButton(cmd))
+ rbcmd=(QRadioButton(tr(cmd)))
self.buttonGroup.addButton(rbcmd)
self.commandesLayout.addWidget(rbcmd)
rbcmd.mouseDoubleClickEvent=self.mouseDoubleClickEvent
self.connect(self.buttonGroup, SIGNAL("buttonClicked(QAbstractButton*)"),self.rbClique)
- else :
+ elif self.affiche_groupe==1 :
listeGroupes,dictGroupes=self.jdc.get_groups()
for grp in listeGroupes:
if grp == "CACHE" : continue
label=QLabel(self)
- text=QString.fromUtf8('<html><head/><body><p><span style=\" font-weight:600;\">Groupe : '+grp+'</span></p></body></html>')
+ text=QString.fromUtf8('<html><head/><body><p><span style=\" font-weight:600;\">Groupe : '+tr(grp)+'</span></p></body></html>')
label.setText(text)
self.listeWidget.append(label)
aAjouter=1
if aAjouter == 1 :
self.commandesLayout.addWidget(label)
aAjouter=0
- rbcmd=(QRadioButton(cmd))
+ rbcmd=(QRadioButton(tr(cmd)))
self.buttonGroup.addButton(rbcmd)
self.commandesLayout.addWidget(rbcmd)
rbcmd.mouseDoubleClickEvent=self.mouseDoubleClickEvent
label2.setText(" ")
self.listeWidget.append(label2)
self.commandesLayout.addWidget(label2)
+ elif self.affiche_ordre==1 :
+ listeFiltre=self.CreeListeCommande(filtre)
+ liste=[]
+ if self.editor.Ordre_Des_Commandes == None : Ordre_Des_Commandes=listeFiltre
+ else : Ordre_Des_Commandes=self.editor.Ordre_Des_Commandes
+ for cmd in Ordre_Des_Commandes :
+ if cmd in listeFiltre :
+ liste.append(cmd)
+ for cmd in liste :
+ rbcmd=(QRadioButton(tr(cmd)))
+ self.buttonGroup.addButton(rbcmd)
+ self.commandesLayout.addWidget(rbcmd)
+ rbcmd.mouseDoubleClickEvent=self.mouseDoubleClickEvent
+ self.connect(self.buttonGroup, SIGNAL("buttonClicked(QAbstractButton*)"),self.rbClique)
def LEfiltreReturnPressed(self):
commentaire=""
self.editor.labelCommentaire.setText(commentaire)
- def bOkPressed(self):
- if self.name==None :
- QMessageBox.critical(None, tr("Commande non choisie "),
- tr("Vous devez choisir une commande") )
- return
- #new_node = self.node.append_child(self.name,'first')
- self.node.tree.choisitPremier(self.name)
def setValide(self):