From: bourcier <> Date: Thu, 10 May 2007 09:03:49 +0000 (+0000) Subject: On n'affiche la boite de dialogue de sélection de géométrie principale que lorsqu... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3424f2a59f521578919e38bb8429f1c784b6cfa7;p=modules%2Feficas.git On n'affiche la boite de dialogue de sélection de géométrie principale que lorsqu'il y en a plus qu'une. --- diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index e915555c..1977d49a 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -342,31 +342,36 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): mainShapes[ subShapeName ].append( mainShapeEntry ) else: mainShapes[ subShapeName ] = [ mainShapeEntry ] - mainShapeEntries += [ mainShapeEntry ] + if not mainShapeEntry in mainShapeEntries: + mainShapeEntries += [ mainShapeEntry ] if mainShapes: - diag = SelectMainShapeDiagImpl( mainShapeEntries, self.parent ) - - if diag.exec_loop() == qt.QDialog.Accepted: - selectedMainShape = diag.getUserSelection() - print 'main shape user selection ->',selectedMainShape - # added by _CS_cbo issue10681 REX - self.mainShapeEntries[ jdcID ] = selectedMainShape - - # filtre sur la main shape sélectionnée - for name in groupeMaNamesIn: - try: - if selectedMainShape in mainShapes[ name ] : - groupeMaNamesOut += [ name ] - except: - pass - - for name in groupeNoNamesIn: - try: - if selectedMainShape in mainShapes[ name ] : - groupeNoNamesOut += [ name ] - except: - pass + if len(mainShapeEntries)>1: + diag = SelectMainShapeDiagImpl( mainShapeEntries, self.parent ) + + if diag.exec_loop() == qt.QDialog.Accepted: + selectedMainShape = diag.getUserSelection() + print 'main shape user selection ->',selectedMainShape + + else: + selectedMainShape = mainShapeEntries[0] + + self.mainShapeEntries[ jdcID ] = selectedMainShape + + # filtre sur la main shape sélectionnée + for name in groupeMaNamesIn: + try: + if selectedMainShape in mainShapes[ name ] : + groupeMaNamesOut += [ name ] + except: + pass + + for name in groupeNoNamesIn: + try: + if selectedMainShape in mainShapes[ name ] : + groupeNoNamesOut += [ name ] + except: + pass return groupeMaNamesOut, groupeNoNamesOut