Salome HOME
suite chgt copyright et menage
[tools/eficas.git] / InterfaceQT4 / monWidgetInactif.py
1 # Copyright (C) 2007-2017   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 __future__ import absolute_import
23 from PyQt5.QtWidgets import QWidget
24
25 from Extensions.i18n import tr
26 from desWidgetInactif import Ui_WidgetInactif
27 import Accas 
28 import os
29
30     
31 # Import des panels
32
33 class MonWidgetInactif(QWidget,Ui_WidgetInactif):
34   """
35   """
36   def __init__(self,node,editor):
37        QWidget.__init__(self,None)
38        self.node=node
39        self.editor=editor
40        self.setupUi(self)
41        from .monWidgetOptionnel import MonWidgetOptionnel
42        if self.editor.widgetOptionnel!= None :
43           self.monOptionnel=self.editor.widgetOptionnel
44        else :
45           self.monOptionnel=MonWidgetOptionnel(self)
46           self.editor.widgetOptionnel=self.monOptionnel
47           self.editor.splitter.addWidget(self.monOptionnel)
48           self.editor.restoreSplitterSizes()
49        self.afficheOptionnel()
50        self.bAvant.clicked.connect(self.afficheAvant)
51        self.bApres.clicked.connect(self.afficheApres)
52        self.bCatalogue.clicked.connect(self.afficheCatalogue)
53        self.labelNomCommande.setText(tr(self.node.item.nom))
54        self.labelNomCommande.setEnabled(False)
55
56   def traiteClicSurLabel(self):
57       pass
58   
59   def donnePremier(self):
60       pass
61
62   def setValide(self):
63       pass 
64
65   def afficheOptionnel(self):
66       # N a pas de parentQt. doit donc etre redefini
67       liste=[]
68       #print "dans afficheOptionnel", self.monOptionnel
69       # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple)
70       #if self.monOptionnel == None : return
71       self.monOptionnel.parentMC=self
72       self.monOptionnel.afficheOptionnelVide()
73
74
75   def afficheCatalogue(self):
76       if self.editor.widgetOptionnel != None : self.monOptionnel.hide()
77       self.node.tree.racine.affichePanneau()
78       self.node.tree.racine.select()
79
80   def afficheApres(self):
81        self.node.selectApres()
82
83   def afficheAvant(self):
84        self.node.selectAvant()
85
86