]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
DisplayAllAnnotations correction.
authornds <nds@opencascade.com>
Thu, 17 Nov 2016 11:29:07 +0000 (14:29 +0300)
committernds <nds@opencascade.com>
Thu, 17 Nov 2016 11:29:07 +0000 (14:29 +0300)
src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx

index b245a14f91724fb2bf6dfd7c4f2dd6427d3cc343..c7da2ae32c1c2dc9bc2615980619e89f178e066e 100755 (executable)
@@ -525,9 +525,6 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
   GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
 
   QMenu aMenu;
-  aMenu.addAction( aModule->action(GEOMOp::OpShowAllAnnotations) );
-  aMenu.addAction( aModule->action(GEOMOp::OpHideAllAnnotations) );
-
   if ( !selectedItems().isEmpty() && selectedItems().count() == 1 ) {
     QTreeWidgetItem* anItem = selectedItems().first();
     QString anEntry = entryFromItem( anItem->parent() );
@@ -538,7 +535,6 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
 
       if ( aProp->GetNumber() == 0 )
         return;
-      aMenu.clear();
       // Edit annotation action
       QAction* anEditAction = aModule->action(GEOMOp::OpEditAnnotation);
       if ( anEditAction )
@@ -553,6 +549,8 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
         aMenu.addAction( myActions[GEOMOp::OpShow] );
     }
   }
+  aMenu.addAction( aModule->action(GEOMOp::OpShowAllAnnotations) );
+  aMenu.addAction( aModule->action(GEOMOp::OpHideAllAnnotations) );
   QAction* selPopupItem = aMenu.exec( viewport()->mapToGlobal(pos) );
 
   if ( selPopupItem == myActions[GEOMOp::OpShow] ||