]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Preparation for Edit implementation
authornds <natalia.ermolaeva@opencascade.com>
Tue, 8 Nov 2016 09:17:13 +0000 (12:17 +0300)
committernds <natalia.ermolaeva@opencascade.com>
Tue, 8 Nov 2016 09:17:13 +0000 (12:17 +0300)
src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GeometryGUI.cxx
src/MeasureGUI/MeasureGUI.cxx

index a70cce9b0f976a0de086781eabd6608b82f5ad13..c7aeee56178464b9e0b2fb39f022bed585ef581f 100644 (file)
@@ -524,6 +524,13 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
       if ( aProp->GetNumber() == 0 )
         return;
       aMenu.clear();
+      // Edit annotation action
+      CAM_Application* anApp = dynamic_cast<CAM_Application*>(myStudy->application());
+      GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
+      QAction* anEditAction = aModule->action(GEOMOp::OpEditAnnotation);
+      if ( anEditAction )
+        aMenu.addAction( anEditAction );
+      // Show/Hide actions
       if ( aProp->GetIsVisible( idFromItem( anItem ) ) )
         aMenu.addAction( myActions[GEOMOp::OpHide] );
       else
index 28a048ae1bd582dd88ecfd07001ed6cc4af078e6..dce9204b58350ceb4982eb2a731ab5cf30521b76 100755 (executable)
@@ -5016,6 +5016,18 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_ANNOTATION</source>
         <translation>Annotation</translation>
     </message>
+    <message>
+        <source>TOP_EDIT_ANNOTATION</source>
+        <translation>Edit Annotation</translation>
+    </message>
+    <message>
+        <source>MEN_EDIT_ANNOTATION</source>
+        <translation>Edit</translation>
+    </message>
+    <message>
+        <source>STB_EDIT_ANNOTATION</source>
+        <translation>Edit Annotation</translation>
+    </message>
     <message>
         <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
         <translation>Show dependency tree</translation>
index 83705e6d23e478363e42dd30d8837ce8b37da951..7153430229617fabd78b1bc7977afb20328e30de 100644 (file)
@@ -676,6 +676,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpFastCheckInters:    // MENU MEASURE - FAST CHECK INTERSECTIONS
   case GEOMOp::OpManageDimensions:   // MENU MEASURE - MANAGE DIMENSIONS
   case GEOMOp::OpAnnotation:         // MENU MEASURE - ANNOTATION
+  case GEOMOp::OpEditAnnotation:     // POPUP MENU - EDIT ANNOTATION
 #ifndef DISABLE_PLOT2DVIEWER
   case GEOMOp::OpShapeStatistics:    // MENU MEASURE - SHAPE STATISTICS
 #endif
@@ -1060,6 +1061,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpAngle,            "MEASURE_ANGLE" );
   createGeomAction( GEOMOp::OpManageDimensions, "MANAGE_DIMENSIONS" );
   createGeomAction( GEOMOp::OpAnnotation,       "ANNOTATION" );
+  createGeomAction( GEOMOp::OpEditAnnotation,   "EDIT_ANNOTATION" );
 
   createGeomAction( GEOMOp::OpTolerance,        "TOLERANCE" );
   createGeomAction( GEOMOp::OpWhatIs,           "WHAT_IS" );
@@ -1609,6 +1611,10 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->setRule( action( GEOMOp::OpNoAutoColor ), autoColorPrefix + " and isAutoColor=true", QtxPopupMgr::VisibleRule );
   mgr->insert( separator(), -1, -1 );     // -----------
 
+  mgr->insert( action(  GEOMOp::OpEditAnnotation ), -1, -1 );  // edit annotation
+  mgr->setRule( action( GEOMOp::OpEditAnnotation ),  QString("($component={'GEOM'}) and type='Shape' and selcount=1"), QtxPopupMgr::VisibleRule );
+  mgr->insert( separator(), -1, -1 );     // -----------
+
   QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ",
           onlyComponent = "((type='Component') and selcount=1)",
           rule = canDisplay + "and ((($type in {%1}) and( %2 )) or " + onlyComponent + ")",
index b2371f945e8027d7c3cf39097c85844327172e00..19eccc5fb6c7b4830b059bd27dc03f51c7b9eaa9 100644 (file)
@@ -113,14 +113,12 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpAngle: 
     dlg = new MeasureGUI_AngleDlg( getGeometryGUI(), parent );
     break; // ANGLE
-  case GEOMOp::OpAnnotation: {
-       dlg = new MeasureGUI_AnnotationDlg( getGeometryGUI(), true, parent );
-    } // ANNOTATION
-    break;
-  case GEOMOp::OpEditAnnotation: {
+  case GEOMOp::OpAnnotation:
+    dlg = new MeasureGUI_AnnotationDlg( getGeometryGUI(), true, parent );
+    break; // ANNOTATION
+  case GEOMOp::OpEditAnnotation:
     dlg = new MeasureGUI_AnnotationDlg( getGeometryGUI(), false, parent );
-       } // ANNOTATION
-       break;
+    break; // ANNOTATION
   case GEOMOp::OpTolerance: 
     dlg = new MeasureGUI_MaxToleranceDlg( getGeometryGUI(), parent );
     break; // MAXTOLERANCE