Salome HOME
bug de CBChecked a True
[tools/eficas.git] / InterfaceQT4 / monWidgetInactif.py
1 # Copyright (C) 2007-2013   EDF R&D
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19 # Modules Python
20 # Modules Eficas
21
22 from determine import monEnvQT5
23 if monEnvQT5 :
24    from PyQt5.QtWidgets import QWidget
25 else :
26    from PyQt4.QtGui import *
27    from PyQt4.QtCore import *
28
29 from Extensions.i18n import tr
30 from desWidgetInactif import Ui_WidgetInactif
31 import Accas 
32 import os
33 import string
34
35     
36 # Import des panels
37
38 class MonWidgetInactif(QWidget,Ui_WidgetInactif):
39   """
40   """
41   def __init__(self,node,editor):
42        QWidget.__init__(self,None)
43        self.node=node
44        self.editor=editor
45        self.setupUi(self)
46        from monWidgetOptionnel import MonWidgetOptionnel
47        if self.editor.widgetOptionnel!= None :
48           self.monOptionnel=self.editor.widgetOptionnel
49        else :
50           self.monOptionnel=MonWidgetOptionnel(self)
51           self.editor.widgetOptionnel=self.monOptionnel
52           self.editor.splitter.addWidget(self.monOptionnel)
53           self.editor.restoreSplitterSizes()
54        self.afficheOptionnel()
55        if monEnvQT5 :
56           self.bAvant.clicked.connect(self.afficheAvant)
57           self.bApres.clicked.connect(self.afficheApres)
58           self.bCatalogue.clicked.connect(self.afficheCatalogue)
59        else :
60           self.connect(self.bAvant,SIGNAL("clicked()"), self.afficheAvant)
61           self.connect(self.bApres,SIGNAL("clicked()"), self.afficheApres)
62           self.connect(self.bCatalogue,SIGNAL("clicked()"), self.afficheCatalogue)
63        self.labelNomCommande.setText(tr(self.node.item.nom))
64        self.labelNomCommande.setEnabled(False)
65
66   def traiteClicSurLabel(self):
67       pass
68   
69   def donnePremier(self):
70       pass
71
72   def setValide(self):
73       pass 
74
75   def afficheOptionnel(self):
76       # N a pas de parentQt. doit donc etre redefini
77       liste=[]
78       #print "dans afficheOptionnel", self.monOptionnel
79       # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
80       #if self.monOptionnel == None : return
81       self.monOptionnel.parentMC=self
82       self.monOptionnel.afficheOptionnelVide()
83
84
85   def afficheCatalogue(self):
86       if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
87       self.node.tree.racine.affichePanneau()
88       self.node.tree.racine.select()
89
90   def afficheApres(self):
91        self.node.selectApres()
92
93   def afficheAvant(self):
94        self.node.selectAvant()
95
96