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 PyQt4.QtGui import *
23 from PyQt4.QtCore import *
24 from Extensions.i18n import tr
25 from desWidgetInactif import Ui_WidgetInactif
33 class MonWidgetInactif(QWidget,Ui_WidgetInactif):
36 def __init__(self,node,editor):
37 QWidget.__init__(self,None)
41 from monWidgetOptionnel import MonWidgetOptionnel
42 if self.editor.widgetOptionnel!= None :
43 self.monOptionnel=self.editor.widgetOptionnel
45 self.monOptionnel=MonWidgetOptionnel(self)
46 self.editor.widgetOptionnel=self.monOptionnel
47 self.editor.splitter.addWidget(self.monOptionnel)
48 self.afficheOptionnel()
49 self.connect(self.bAvant,SIGNAL("clicked()"), self.afficheAvant)
50 self.connect(self.bApres,SIGNAL("clicked()"), self.afficheApres)
51 self.connect(self.bCatalogue,SIGNAL("clicked()"), self.afficheCatalogue)
52 self.labelNomCommande.setText(tr(self.node.item.nom))
53 self.labelNomCommande.setEnabled(False)
55 def traiteClicSurLabel(self):
62 def afficheOptionnel(self):
63 # N a pas de parentQt. doit donc etre redefini
65 #print "dans afficheOptionnel", self.monOptionnel
66 # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
67 #if self.monOptionnel == None : return
68 self.monOptionnel.parentMC=self
69 self.monOptionnel.affiche(liste)
72 def afficheCatalogue(self):
73 if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
74 self.node.tree.racine.affichePanneau()
75 self.node.tree.racine.select()
77 def afficheApres(self):
78 self.node.selectApres()
80 def afficheAvant(self):
81 self.node.selectAvant()