From 3d4fe1c70bb60dec2317f1d5063efec5842f6f91 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 2 Apr 2015 15:54:49 +0300 Subject: [PATCH] refs #497: menu optimization --- src/HYDROGUI/HYDROGUI_Module.cxx | 7 ++-- src/HYDROGUI/HYDROGUI_Operations.cxx | 18 +++++----- src/HYDROGUI/HYDROGUI_Operations.h | 6 ++-- .../HYDROGUI_ProfileInterpolateDlg.cxx | 2 +- .../HYDROGUI_ProfileInterpolateOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_RiverBottomDlg.cxx | 2 +- src/HYDROGUI/HYDROGUI_RiverBottomOp.cxx | 4 +-- src/HYDROGUI/resources/HYDROGUI_images.ts | 4 +-- src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 36 ++++++++++--------- 9 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 17679d87..e0f4f8c8 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -608,11 +608,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, else if( anIsStream ) { theMenu->addAction( action( EditStreamId ) ); - if ( action( RiverBottomContext ) ) + if ( action( RiverBottomContextId ) ) { - theMenu->addAction( action( RiverBottomContext ) ); - action( RiverBottomContext )->setEnabled( !isStreamHasBottom ); + theMenu->addAction( action( RiverBottomContextId ) ); + action( RiverBottomContextId )->setEnabled( !isStreamHasBottom ); } + theMenu->addAction( action( ProfileInterpolateId ) ); theMenu->addSeparator(); } else if( anIsChannel ) diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 9f440a6a..dafb8516 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -183,9 +183,9 @@ void HYDROGUI_Module::createActions() createAction( HideId, "HIDE" ); createAction( HideAllId, "HIDE_ALL" ); - createAction( RiverBottom, "CREATE_RIVER_BOTTOM", "CREATE_RIVER_BOTTOM_ICO" ); - createAction( RiverBottomContext, "CREATE_RIVER_BOTTOM", "CREATE_RIVER_BOTTOM_ICO" ); - createAction( ProfileInterpolate, "PROFILE_INTERPOLATE", "PROFILE_INTERPOLATE_ICO" ); + createAction( RiverBottomId, "CREATE_STREAM_BOTTOM", "CREATE_STREAM_BOTTOM_ICO" ); + createAction( RiverBottomContextId, "CREATE_STREAM_BOTTOM", "CREATE_STREAM_BOTTOM_ICO" ); + createAction( ProfileInterpolateId, "PROFILE_INTERPOLATE", "PROFILE_INTERPOLATE_ICO" ); } void HYDROGUI_Module::createMenus() @@ -208,14 +208,16 @@ void HYDROGUI_Module::createMenus() createMenu( ImportBathymetryId, aHydroId, -1, -1 ); createMenu( CreatePolylineId, aHydroId, -1, -1 ); createMenu( CreatePolyline3DId, aHydroId, -1, -1 ); - createMenu( RiverBottom, aHydroId, -1, -1 ); createMenu( EditLocalCSId, aHydroId, -1, -1 ); int aNewProfileId = createMenu( tr( "MEN_DESK_PROFILE" ), aHydroId, -1 ); createMenu( CreateProfileId, aNewProfileId, -1, -1 ); createMenu( ImportProfilesId, aNewProfileId, -1, -1 ); createMenu( AllGeoreferencementId, aNewProfileId, -1, -1 ); - createMenu( ProfileInterpolate, aNewProfileId, -1, -1 ); + + int aStreamMenuId = createMenu( tr( "MEN_DESK_STREAM" ), aHydroId, -1 ); + createMenu( RiverBottomId, aStreamMenuId, -1, -1 ); + createMenu( ProfileInterpolateId, aStreamMenuId, -1, -1 ); int anArtificialMenuId = createMenu( tr( "MEN_DESK_ARTIFICIAL" ), aHydroId, -1 ); createMenu( CreateChannelId, anArtificialMenuId, -1, -1 ); @@ -427,7 +429,7 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case EditProfileId: anOp = new HYDROGUI_ProfileOp( aModule, theId == EditProfileId ); break; - case ProfileInterpolate: + case ProfileInterpolateId: anOp = new HYDROGUI_ProfileInterpolateOp( aModule ); break; case ImportProfilesId: @@ -516,8 +518,8 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case EditLocalCSId: anOp = new HYDROGUI_LocalCSOp( aModule ); break; - case RiverBottom: - case RiverBottomContext: + case RiverBottomId: + case RiverBottomContextId: anOp = new HYDROGUI_RiverBottomOp( aModule ); break; case ShowId: diff --git a/src/HYDROGUI/HYDROGUI_Operations.h b/src/HYDROGUI/HYDROGUI_Operations.h index ac51a871..6c154564 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.h +++ b/src/HYDROGUI/HYDROGUI_Operations.h @@ -107,9 +107,9 @@ enum OperationId SetZLevelId, EditLocalCSId, - RiverBottom, - RiverBottomContext, - ProfileInterpolate + RiverBottomId, + RiverBottomContextId, + ProfileInterpolateId }; #endif diff --git a/src/HYDROGUI/HYDROGUI_ProfileInterpolateDlg.cxx b/src/HYDROGUI/HYDROGUI_ProfileInterpolateDlg.cxx index ff381785..e6ab36b5 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileInterpolateDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileInterpolateDlg.cxx @@ -56,7 +56,7 @@ HYDROGUI_ProfileInterpolateDlg::HYDROGUI_ProfileInterpolateDlg( HYDROGUI_Module* addWidget( main ); - base->addWidget( new QLabel( tr( "RIVER_OBJECT" ), main ), 0, 0, 1, 1 ); + base->addWidget( new QLabel( tr( "STREAM_OBJECT" ), main ), 0, 0, 1, 1 ); base->addWidget( myRiver = new HYDROGUI_ObjComboBox( theModule, QString::null, KIND_STREAM, main ), 0, 1, 1, 1 ); base->addWidget( new QLabel( tr( "INTERPOLATOR" ), main ), 1, 0, 1, 1 ); diff --git a/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx b/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx index 0f8d398f..fd46bc54 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx @@ -147,7 +147,7 @@ bool HYDROGUI_ProfileInterpolateOp::processApply( int& theUpdateFlags, QString& } } else - errMessage = tr( "CANT_GET_RIVER_OBJECT" ).arg( aDlg->river() ); + errMessage = tr( "CANT_GET_STREAM_OBJECT" ).arg( aDlg->river() ); if ( !errMessage.isEmpty() ) QMessageBox::critical( aDlg->topLevelWidget(), tr( "INTERPOLATION_ERROR" ), errMessage, QMessageBox::Ok ); diff --git a/src/HYDROGUI/HYDROGUI_RiverBottomDlg.cxx b/src/HYDROGUI/HYDROGUI_RiverBottomDlg.cxx index 73192779..a8787715 100644 --- a/src/HYDROGUI/HYDROGUI_RiverBottomDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_RiverBottomDlg.cxx @@ -41,7 +41,7 @@ HYDROGUI_RiverBottomDlg::HYDROGUI_RiverBottomDlg( HYDROGUI_Module* theModule, co QGroupBox* group = new QGroupBox( mainFrame() ); QBoxLayout* base = new QVBoxLayout( group ); - base->addWidget( myRivers = new HYDROGUI_ObjComboBox( theModule, tr( "RIVER_OBJECT" ), KIND_STREAM, group ) ); + base->addWidget( myRivers = new HYDROGUI_ObjComboBox( theModule, tr( "STREAM_OBJECT" ), KIND_STREAM, group ) ); myRivers->setObjectFilter( this ); addWidget( group ); diff --git a/src/HYDROGUI/HYDROGUI_RiverBottomOp.cxx b/src/HYDROGUI/HYDROGUI_RiverBottomOp.cxx index 87ce6116..a3b96820 100644 --- a/src/HYDROGUI/HYDROGUI_RiverBottomOp.cxx +++ b/src/HYDROGUI/HYDROGUI_RiverBottomOp.cxx @@ -49,7 +49,7 @@ HYDROGUI_RiverBottomOp::HYDROGUI_RiverBottomOp( HYDROGUI_Module* theModule ) : HYDROGUI_Operation( theModule ) { - setName( tr( "FIND_RIVER_BOTTOM" ) ); + setName( tr( "FIND_STREAM_BOTTOM" ) ); } HYDROGUI_RiverBottomOp::~HYDROGUI_RiverBottomOp() @@ -91,7 +91,7 @@ bool HYDROGUI_RiverBottomOp::processApply( int& theUpdateFlags, QString& theErro Handle(HYDROData_Stream) aRiver = riverObject( aPanel->getRiverName() ); if ( aRiver.IsNull() ) { - theErrorMsg = tr( "INCORRECT_RIVER_OBJECT" ); + theErrorMsg = tr( "INCORRECT_STREAM_OBJECT" ); return false; } diff --git a/src/HYDROGUI/resources/HYDROGUI_images.ts b/src/HYDROGUI/resources/HYDROGUI_images.ts index 539367de..dbbf4380 100644 --- a/src/HYDROGUI/resources/HYDROGUI_images.ts +++ b/src/HYDROGUI/resources/HYDROGUI_images.ts @@ -388,8 +388,8 @@ - CREATE_RIVER_BOTTOM_ICO - icon_river_bottom_image.png + CREATE_STREAM_BOTTOM_ICO + icon_stream_bottom_image.png diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 6721f635..58c93cde 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -942,6 +942,10 @@ Would you like to remove all references from the image? MEN_DESK_HYDRO HYDRO + + MEN_DESK_STREAM + Stream + MEN_DESK_NATURAL Natural objects @@ -1344,29 +1348,29 @@ Would you like to remove all references from the image? - MEN_CREATE_RIVER_BOTTOM + MEN_CREATE_STREAM_BOTTOM Find bottom - DSK_CREATE_RIVER_BOTTOM - Create river bottom polyline + DSK_CREATE_STREAM_BOTTOM + Create stream bottom polyline - STB_CREATE_RIVER_BOTTOM - Creates the river bottom polyline on selected river object + STB_CREATE_STREAM_BOTTOM + Creates the stream bottom polyline on selected stream object MEN_PROFILE_INTERPOLATE - River profiles interpolation + Profiles interpolation DSK_PROFILE_INTERPOLATE - Interpolate the river profiles + Interpolate the stream profiles STB_PROFILE_INTERPOLATE - Creates the new river profiles using interpolation of selected ones + Creates the new stream profiles using interpolation of selected ones @@ -2263,24 +2267,24 @@ Polyline should consist from one not closed curve. HYDROGUI_RiverBottomDlg - RIVER_OBJECT - River object + STREAM_OBJECT + Stream object HYDROGUI_RiverBottomOp - FIND_RIVER_BOTTOM - Find river bottom + FIND_STREAM_BOTTOM + Find stream bottom HYDROGUI_ProfileInterpolateDlg - RIVER_OBJECT - River object + STREAM_OBJECT + Stream object INTERPOLATOR @@ -2323,8 +2327,8 @@ Polyline should consist from one not closed curve. Can't perform calculation: %1 - CANT_GET_RIVER_OBJECT - Can't obtain river oject \"%1\" + CANT_GET_STREAM_OBJECT + Can't obtain stream oject \"%1\" -- 2.39.2