Salome HOME
Pour V1 Carmel
[tools/eficas.git] / InterfaceQT4 / monChoixCommande.py
index 6dd35550d967f850437c7db23536c5a9a3ae5cf7..fb803fd8379a4f2aa77c7c67a8936cf0609dcb28 100644 (file)
@@ -60,6 +60,7 @@ class MonChoixCommande(Ui_ChoixCommandes,QtGui.QWidget):
       self.name=None
       self.AjouteRadioButton()
       self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.AjouteRadioButton)
+      if self.editor.affiche_alpha==0 : self.afficheGroupe()
 
   def afficheAlpha(self):
       self.affiche_alpha=1
@@ -79,12 +80,19 @@ class MonChoixCommande(Ui_ChoixCommandes,QtGui.QWidget):
       nodeCourrant=self.node.tree.currentItem()
       if nodeCourrant==None: nodeCourrant=self.node.tree.racine
       if self.name != None :
-         if nodeCourrant==self.node : nouveau=self.node.append_child(self.name,'first')
-         else : nouveau=nodeCourrant.append_brother(self.name)
-         print "je suis la"
-         from InterfaceQT4 import compojdc
-         if self.editor.afficheCommandesPliees==True and isinstance(nouveau.treeParent,compojdc.Node) :
-            nouveau.plieToutEtReaffiche()
+         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)
+      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()
+      event.accept()
+      
 
   def CreeListeCommande(self,filtre):
       listeGroupes,dictGroupes=self.jdc.get_groups()
@@ -161,13 +169,6 @@ class MonChoixCommande(Ui_ChoixCommandes,QtGui.QWidget):
            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):