From 3424f2a59f521578919e38bb8429f1c784b6cfa7 Mon Sep 17 00:00:00 2001 From: bourcier <> Date: Thu, 10 May 2007 09:03:49 +0000 Subject: [PATCH] =?utf8?q?On=20n'affiche=20la=20boite=20de=20dialogue=20de?= =?utf8?q?=20s=C3=A9lection=20de=20g=C3=A9om=C3=A9trie=20principale=20que?= =?utf8?q?=20lorsqu'il=20y=20en=20a=20plus=20qu'une.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/EFICASGUI/eficasSalome.py | 51 +++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 23 deletions(-) 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 -- 2.39.2