From: nds Date: Tue, 8 Nov 2016 09:17:13 +0000 (+0300) Subject: Preparation for Edit implementation X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f92ec3a03e30b2f2e63672295a46bea61525923e;p=modules%2Fgeom.git Preparation for Edit implementation --- diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx index a70cce9b0..c7aeee561 100644 --- a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx @@ -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(myStudy->application()); + GeometryGUI* aModule = dynamic_cast(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 diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 28a048ae1..dce9204b5 100755 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -5016,6 +5016,18 @@ Please, select face, shell or solid and try again STB_ANNOTATION Annotation + + TOP_EDIT_ANNOTATION + Edit Annotation + + + MEN_EDIT_ANNOTATION + Edit + + + STB_EDIT_ANNOTATION + Edit Annotation + MEN_POP_SHOW_DEPENDENCY_TREE Show dependency tree diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 83705e6d2..715343022 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -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 + ")", diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index b2371f945..19eccc5fb 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -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