bool isPoly = anIsPolyline || anIsPolyline3D;
if (isPoly && !anIsLandCoverMap)
theMenu->addAction( action( ExportToShapeFileID ) );
- if( isPoly )
- theMenu->addAction( action( PolylineStyleId ) );
// Add copy action
QAction* aCopyAction = action( CopyId );
}
}
}
+
+ bool isPoly = anIsPolyline || anIsPolyline3D;
+ if( isPoly )
+ {
+ theMenu->addSeparator();
+ QAction* a = action( ShowHideArrows );
+ a->setText( arrowsVisible() ? tr( "HIDE_ARROWS" ) : tr( "SHOW_ARROWS" ) );
+ theMenu->addAction( a );
+ }
}
void HYDROGUI_Module::createPreferences()
createAction( LandCoverScalarMapModeOnId, "LC_SCALARMAP_COLORING_ON" );
createAction( LandCoverScalarMapModeOffId, "LC_SCALARMAP_COLORING_OFF" );
- createAction( PolylineStyleId, "POLYLINE_STYLE" );
+ createAction( ShowHideArrows, "SHOW_HIDE_ARROWS" );
}
void HYDROGUI_Module::createMenus()
int anId = actionId( anAction );
if( anId >= 0 )
startOperation( anId );
+
+ if( anId==ShowHideArrows )
+ {
+ setArrowsVisible( !arrowsVisible() );
+ }
+}
+
+bool HYDROGUI_Module::arrowsVisible() const
+{
+ int aType;
+ SUIT_ResourceMgr* resMgr = application()->resourceMgr();
+ if( resMgr )
+ {
+ resMgr->value( "polyline", "arrow_type", aType );
+ return aType>0;
+ }
+ else
+ return false;
+}
+
+void HYDROGUI_Module::setArrowsVisible( bool isVisible )
+{
+ SUIT_ResourceMgr* resMgr = application()->resourceMgr();
+
+ int aType=-1;
+ if( !resMgr )
+ return;
+
+ if( isVisible )
+ {
+ if( resMgr->hasValue( "polyline", "prev_arrow_type" ) )
+ resMgr->value( "polyline", "prev_arrow_type", aType );
+ resMgr->setValue( "polyline", "arrow_type", aType );
+ }
+ else
+ {
+ resMgr->value( "polyline", "arrow_type", aType );
+ resMgr->setValue( "polyline", "prev_arrow_type", aType );
+ resMgr->setValue( "polyline", "arrow_type", 0 );
+ }
+ preferencesChanged( "polyline", "arrow_type" );
}
void HYDROGUI_Module::onDelete()
case LandCoverScalarMapModeOffId:
anOp = new HYDROGUI_LandCoverColoringOp( aModule, theId );
break;
- case PolylineStyleId:
- anOp = new HYDROGUI_PolylineStyleOp( aModule );
- break;
}
if( !anOp )
<translation>Default rescale bathymetry</translation>
</message>
<message>
- <source>DSK_POLYLINE_STYLE</source>
- <translation>Polyline style</translation>
+ <source>DSK_SHOW_HIDE_ARROWS</source>
+ <translation>Show/hide arrows</translation>
</message>
<message>
<source>DSK_IMPORT_IMAGE</source>
<translation>Default rescale bathymetry</translation>
</message>
<message>
- <source>MEN_POLYLINE_STYLE</source>
- <translation>Polyline style</translation>
+ <source>MEN_SHOW_HIDE_ARROWS</source>
+ <translation>Show/hide arrows</translation>
+ </message>
+ <message>
+ <source>HIDE_ARROWS</source>
+ <translation>Hide arrows</translation>
+ </message>
+ <message>
+ <source>SHOW_ARROWS</source>
+ <translation>Show arrows</translation>
</message>
<message>
<source>MEN_IMPORT_IMAGE</source>