]> SALOME platform Git repositories - modules/hydrosolver.git/commitdiff
Salome HOME
TODO: fix better a strange bug with sobj==None when right clic on 3Dview in HYDROSOLV...
authorPaul RASCLE <paul.rascle@edf.fr>
Fri, 8 Nov 2019 15:54:51 +0000 (16:54 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Fri, 8 Nov 2019 15:55:35 +0000 (16:55 +0100)
src/HYDROGUI/HYDROSOLVERGUI.py

index 6521a77f5a83867720d4a521de3bf1f2534ed961..6facd594ce16dc68f7f9ef8b49b111ab7e48f22b 100755 (executable)
@@ -320,17 +320,19 @@ def createPopupMenu(popup, context):
     if salome.sg.SelectedCount() == 1:
         # one object is selected
         sobj = ed.study.FindObjectID(salome.sg.getSelected(0))
-        selectedType = ed.getTypeId(sobj)
-        if selectedType == hydro_study.TELMA_TYPE_ID:
-            popup.addAction(sgPyQt.action(GUIcontext.EDIT_TELMA_CAS_ID))
-        elif selectedType == hydro_study.PARAM_STUDY_TYPE_ID:
-            popup.addAction(sgPyQt.action(GUIcontext.EDIT_PARAM_STUDY_ID))
-            popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_PYTHON_ID))
-            popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_YACS_ID))
-        elif selectedType == hydro_study.STUDY_TYPE_ID:
-            popup.addAction(sgPyQt.action(GUIcontext.EDIT_STUDY_ID))
-            popup.addAction(sgPyQt.action(GUIcontext.RUN_STUDY_ID))
-            popup.addAction(sgPyQt.action(GUIcontext.GEN_STUDY_BATCH_ID))
+        print("sobj: %s"%sobj) # strange bug with sobj is None when right clic on 3Dview in HYDROSOLVER used after HYDRO (generate AssignStrickler)
+        if sobj:
+            selectedType = ed.getTypeId(sobj)
+            if selectedType == hydro_study.TELMA_TYPE_ID:
+                popup.addAction(sgPyQt.action(GUIcontext.EDIT_TELMA_CAS_ID))
+            elif selectedType == hydro_study.PARAM_STUDY_TYPE_ID:
+                popup.addAction(sgPyQt.action(GUIcontext.EDIT_PARAM_STUDY_ID))
+                popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_PYTHON_ID))
+                popup.addAction(sgPyQt.action(GUIcontext.GEN_PARAM_STUDY_YACS_ID))
+            elif selectedType == hydro_study.STUDY_TYPE_ID:
+                popup.addAction(sgPyQt.action(GUIcontext.EDIT_STUDY_ID))
+                popup.addAction(sgPyQt.action(GUIcontext.RUN_STUDY_ID))
+                popup.addAction(sgPyQt.action(GUIcontext.GEN_STUDY_BATCH_ID))
 
 # called when GUI action is activated
 # action ID is passed as parameter