icon = QIcon(self.RepIcon+"/image240.png")
self.BSalome.setIcon(icon)
mc = self.node.item.get_definition()
- #if ( (self.node.item.get_nom() != "FileName" ) and ( mc.type[0]!="Fichier")) :
- if mc.type[0] == "Fichier" or mc.type[0] == "FichierNoAbs":
+ mctype = mc.type[0]
+ if mctype == "Fichier" or mctype == "FichierNoAbs" or \
+ (hasattr(mctype, "enable_file_selection") and mctype.enable_file_selection):
self.bParametres.close()
self.BRepertoire.close()
- elif mc.type[0] == "Repertoire":
+ elif mctype == "Repertoire":
self.bParametres.close()
self.BFichier.close()
else :
self.BFichier.close()
self.BRepertoire.close()
- type = mc.type[0]
# TODO: Use type properties instead of hard-coded "grno" and "grma" type check
enable_salome_selection = self.editor.salome and \
- (('grma' in repr(type)) or ('grno' in repr(type)) or
- (hasattr(type, "enable_salome_selection") and type.enable_salome_selection))
+ (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or
+ (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection))
if not enable_salome_selection:
self.BSalome.close()
- if not(('grma' in repr(type)) or ('grno' in repr(type))) or not(self.editor.salome) :
+ if not(('grma' in repr(mctype)) or ('grno' in repr(mctype))) or not(self.editor.salome):
self.BView2D.close()
def InitLineEditVal(self):
SaisieValeur.BOk2Pressed(self)
def BFichierPressed(self):
- type = self.node.item.get_definition().type
- if len(type) > 1:
- filters = type[1]
+ mctype = self.node.item.get_definition().type
+ if len(mctype) > 1:
+ filters = mctype[1]
+ elif hasattr(mctype[0], "filters"):
+ filters = mctype[0].filters
else:
filters = QString()
- if len(type) > 2 and type[2] == "Sauvegarde":
+ if len(mctype) > 2 and mctype[2] == "Sauvegarde":
fichier = QFileDialog.getSaveFileName(self.appliEficas,
self.appliEficas.trUtf8('Sauvegarder Fichier'),
self.appliEficas.CONFIGURATION.savedir,
ulfile = os.path.abspath(unicode(fichier))
self.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0]
self.lineEditVal.setText(fichier)
+ self.Commentaire.setText(u"Fichier sélectionné")
if (QFileInfo(fichier).suffix() in listeSuffixe ):
self.image=fichier
if (not hasattr(self,"BSelectInFile")):
def BSalomePressed(self):
self.Commentaire.setText(QString(""))
genea=self.node.item.get_genealogie()
- kwType = None
+ kwType = self.node.item.get_definition().type[0]
for e in genea:
if "GROUP_NO" in e: kwType = "GROUP_NO"
if "GROUP_MA" in e: kwType = "GROUP_MA"
<rect>
<x>0</x>
<y>0</y>
- <width>482</width>
- <height>480</height>
+ <width>782</width>
+ <height>534</height>
</rect>
</property>
<property name="windowTitle">
</layout>
</item>
<item row="1" column="0">
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="0" column="1">
+ <item>
<widget class="QPushButton" name="BSalome">
<property name="minimumSize">
<size>
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QPushButton" name="bParametres">
+ <item>
+ <widget class="QPushButton" name="BView2D">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<property name="minimumSize">
<size>
<width>140</width>
- <height>45</height>
+ <height>40</height>
</size>
</property>
<property name="text">
- <string>Paramètres</string>
+ <string>Visualiser</string>
</property>
</widget>
</item>
- <item row="1" column="0">
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>138</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="1">
- <widget class="QPushButton" name="BView2D">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <item>
+ <widget class="QPushButton" name="bParametres">
<property name="minimumSize">
<size>
<width>140</width>
</size>
</property>
<property name="text">
- <string>Visualiser</string>
+ <string>Paramètres</string>
</property>
</widget>
</item>
- <item row="1" column="2">
+ <item>
<widget class="QPushButton" name="BFichier">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</property>
</widget>
</item>
- <item row="2" column="2">
+ <item>
<widget class="QPushButton" name="BRepertoire">
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>40</height>
+ </size>
+ </property>
<property name="text">
<string>Répertoire</string>
</property>