Salome HOME
sauve du 9 mai
[tools/eficas.git] / InterfaceQT4 / compomclist.py
index 0db1cf88f287da0bfe751e9b6f72540fb89c2439..23e232a9f72361258c8175bd0924e25d68999f15 100644 (file)
@@ -1,4 +1,22 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2007-2013   EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 import types
 import traceback
@@ -6,31 +24,40 @@ import traceback
 import compofact
 import browser
 import typeNode
+from Extensions.i18n import tr
 
 from Editeur     import Objecttreeitem
 from Noyau.N_OBJECT import ErrorObj
-#import compoerror
 
 
 class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal):
-    def getPanel(self):
-        """        
-        """    
-        if self.item.isMCList() :
-           if self.item.ajout_possible():
-              from monMCListAjoutPanel import MonMCListAjoutPanel
-              return MonMCListAjoutPanel(self,parent=self.editor)
-           else :
-              print "MCList"
-        elif self.item.isMCFact() :
-           from monMCFactPanel import MonMCFactPanel
-           return MonMCFactPanel(self,parent=self.editor)
-        else :
-           print "MCList"
 
     def createPopUpMenu(self):
         typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self)
 
+    def getPanelGroupe(self,parentQt,commande):
+        maDefinition=self.item.get_definition()
+        monObjet=self.item.object
+        monNom=self.item.nom
+        maCommande=commande
+        #print "ds getPanelGroupe" , self.item.nom
+        #if hasattr(self,'plie'): print "self.plie", self.plie
+       # if self.item.nom == "BackgroundError" and not(self.plie): print i
+        #print parentQt
+        if hasattr(parentQt,'niveau'): self.niveau=parentQt.niveau+1
+        else : self.niveau=1
+        if not (monObjet.isMCList()) :
+           if  hasattr(self,'plie') and self.plie==True : 
+               from monWidgetFactPlie import MonWidgetFactPlie
+               widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+           else:
+               from monWidgetFact import MonWidgetFact
+               widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+        else :
+           from monWidgetBloc import MonWidgetBloc
+           widget=MonWidgetBloc(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
+        return widget
+
 
     #def doPaste(self,node_selected):
     #    objet_a_copier = self.item.get_copie_objet()
@@ -147,7 +174,6 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
 
     def get_docu(self):
         """ Retourne la clef de doc de l'objet pointé par self """
-        print "hhhhhhhhhhhh"
         return self.object.get_docu()    
 
     def iscopiable(self):
@@ -191,11 +217,10 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem):
         if self.object.suppentite(obj):
            if len(self._object) == 1: self.updateDelegate()     
            message = "Mot-clef " + obj.nom + " supprime"
-           self.appli.affiche_infos(message)
-           return 1
+           #self.editor.affiche_commentaire(message)
+           return (1,message)
         else:
-           self.appli.affiche_infos('Impossible de supprimer ce mot-clef',Qt.red)
-           return 0
+           return (0,tr('Impossible de supprimer ce mot-clef'))
 
             
 import Accas