1 # Copyright (C) 2007-2013 EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 from determine import monEnvQT5
24 from PyQt5.QtWidgets import QCheckBox, QWidget
25 from PyQt5.QtCore import Qt
27 from PyQt4.QtGui import *
28 from PyQt4.QtCore import *
30 from Extensions.i18n import tr
31 from desWidgetOptionnel import Ui_WidgetOptionnel
32 from monGroupeOptionnel import MonGroupeOptionnel
36 class MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel):
37 def __init__(self,parentQt):
38 #print "dans init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
39 QWidget.__init__(self,None)
41 self.dicoMCWidgetOptionnel={}
42 self.parentQt=parentQt
44 def afficheOptionnel(self,liste,MC):
45 #print "dans Optionnel ____ affiche", liste
46 self.vireLesAutres(MC)
47 if self.dicoMCWidgetOptionnel.has_key(MC.node.item.nom) :
48 self.dicoMCWidgetOptionnel[MC.node.item.nom].setParent(None)
49 self.dicoMCWidgetOptionnel[MC.node.item.nom].close()
50 groupe = MonGroupeOptionnel(liste,self,MC)
51 self.groupesOptionnelsLayout.insertWidget(0,groupe)
52 self.dicoMCWidgetOptionnel[MC.node.item.nom]=groupe
55 def vireLesAutres(self,MC):
56 #print "je passe dans vireLesAutres"
57 genea =MC.obj.get_genealogie()
59 for k in self.dicoMCWidgetOptionnel.keys():
61 self.dicoMCWidgetOptionnel[k].close()
62 del self.dicoMCWidgetOptionnel[k]
63 #if k not in genea : print k
66 def afficheOptionnelVide(self):
67 self.GeneaLabel.setText("")
68 for k in self.dicoMCWidgetOptionnel.keys():
69 self.dicoMCWidgetOptionnel[k].close()
70 del self.dicoMCWidgetOptionnel[k]
73 if self.parentCommande.node.editor.code in ['Adao','ADAO'] and self.parentCommande.node.editor.closeFrameRechercheCommande==True :
74 self.frameLabelCommande.close()
76 labeltext,fonte,couleur = self.parentCommande.node.item.GetLabelText()
84 for l in li : texte+=l+"\n"
86 self.GeneaLabel.setText(tr("Options pour \n") +texte)