# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2017 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
monObjet=self.item.object
monNom=self.item.nom
maCommande=commande
- #print "ds getPanelGroupe" , self.item.nom
if hasattr(parentQt,'niveau'): self.niveau=parentQt.niveau+1
else : self.niveau=1
+ # attention si l objet est une mclist on utilise bloc
if not (monObjet.isMCList()) :
if hasattr(self,'plie') and self.plie==True :
- from .monWidgetFactPlie import MonWidgetFactPlie
+ from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie
widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande,insertIn)
else:
- from .monWidgetFact import MonWidgetFact
+ from InterfaceQT4.monWidgetFact import MonWidgetFact
widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande,insertIn)
else :
- from .monWidgetBloc import MonWidgetBloc
+ from InterfaceQT4.monWidgetBloc import MonWidgetBloc
widget=MonWidgetBloc(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande)
return widget
def doPaste(self,node_selected,pos):
- objet_a_copier = self.item.get_copie_objet()
+ objet_a_copier = self.item.getCopieObjet()
# before est un effet de bord heureux sur l index
child=self.appendBrother(objet_a_copier,'before')
if self.editor.fenetreCentraleAffichee : self.editor.fenetreCentraleAffichee.node.affichePanneau()
- self.update_node_label_in_black()
- self.parent().build_children()
+ self.update_NodeLabelInBlack()
+ self.parent().buildChildren()
return child
def updateDelegate(self):
if len(self._object) > 1:
- self.setdelegate(self._object)
+ self.setDelegate(self._object)
else:
- self.setdelegate(self._object.data[0])
+ self.setDelegate(self._object.data[0])
def panel(self,jdcdisplay,pane,node):
""" Retourne une instance de l'objet panneau associe a l'item (self)
else:
return compofact.FACTPanel(jdcdisplay,pane,node)
- def IsExpandable(self):
+ def isExpandable(self):
if len(self._object) > 1:
- return Objecttreeitem.SequenceTreeItem.IsExpandable(self)
+ return Objecttreeitem.SequenceTreeItem.isExpandable(self)
else:
- return compofact.FACTTreeItem.IsExpandable(self)
+ return compofact.FACTTreeItem.isExpandable(self)
- def GetSubList(self):
+ def getSubList(self):
self.updateDelegate()
if len(self._object) <= 1:
self._object.data[0].alt_parent=self._object
- return compofact.FACTTreeItem.GetSubList(self)
+ return compofact.FACTTreeItem.getSubList(self)
liste=self._object.data
sublist=[None]*len(liste)
for obj in liste:
if sublist[pos] is None:
# nouvel objet : on cree un nouvel item
- def setfunction(value, object=obj):
+ def setFunction(value, object=obj):
object=value
- item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, setfunction)
+ item = self.makeObjecttreeitem(self.appli, obj.nom + " : ", obj, setFunction)
sublist[pos]=item
#Attention : on ajoute une information supplementaire pour l'actualisation de
# la validite. L'attribut parent d'un MCFACT pointe sur le parent de la MCLISTE
self.sublist=sublist
return self.sublist
- def GetIconName(self):
- if self._object.isvalid():
+ def getIconName(self):
+ if self._object.isValid():
return "ast-green-los"
- elif self._object.isoblig():
+ elif self._object.isOblig():
return "ast-red-los"
else:
return "ast-yel-los"
- def get_docu(self):
+ def getDocu(self):
""" Retourne la clef de doc de l'objet pointe par self """
- return self.object.get_docu()
+ return self.object.getDocu()
- def iscopiable(self):
+ def isCopiable(self):
if len(self._object) > 1:
- return Objecttreeitem.SequenceTreeItem.iscopiable(self)
+ return Objecttreeitem.SequenceTreeItem.isCopiable(self)
else:
- return compofact.FACTTreeItem.iscopiable(self)
+ return compofact.FACTTreeItem.isCopiable(self)
def isMCFact(self):
"""
"""
return len(self._object) > 1
- def get_copie_objet(self):
+ def getCopieObjet(self):
return self._object.data[0].copy()
- def additem(self,obj,pos):
- #print "compomclist.additem",obj,pos
+ def addItem(self,obj,pos):
+ #print "compomclist.addItem",obj,pos
if len(self._object) <= 1:
- return compofact.FACTTreeItem.additem(self,obj,pos)
+ return compofact.FACTTreeItem.addItem(self,obj,pos)
- o= self.object.addentite(obj,pos)
+ o= self.object.addEntite(obj,pos)
return o
- def suppitem(self,item):
+ def suppItem(self,item):
"""
Retire un objet MCFACT de la MCList (self.object)
"""
- #print "compomclist.suppitem",item
+ #print "compomclist.suppItem",item
obj=item.getObject()
if len(self._object) <= 1:
- return compofact.FACTTreeItem.suppitem(self,item)
+ return compofact.FACTTreeItem.suppItem(self,item)
- if self.object.suppentite(obj):
+ if self.object.suppEntite(obj):
if len(self._object) == 1: self.updateDelegate()
message = "Mot-clef " + obj.nom + " supprime"
- #self.editor.affiche_commentaire(message)
return (1,message)
else:
return (0,tr('Impossible de supprimer ce mot-clef'))
import Accas
objet = Accas.MCList
-def treeitem(appli,labeltext,object,setfunction):
+def treeitem(appli,labeltext,object,setFunction):
""" Factory qui produit un objet treeitem adapte a un objet
Accas.MCList (attribut objet de ce module)
"""
- return MCListTreeItem(appli,labeltext,object,setfunction)
+ return MCListTreeItem(appli,labeltext,object,setFunction)