QString aGuideLineName = aPanel->getGuideLineName();
QString aProfileName = aPanel->getProfileName();
- if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() )
+ /*if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() )
{
myEditedObject->RemoveGuideLine();
myEditedObject->RemoveProfile();
}
- else
+ else*/
{
Handle(HYDROData_Polyline3D) aGuideLine = Handle(HYDROData_Polyline3D)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aGuideLineName, KIND_POLYLINE ) );
+ if ( aGuideLine.IsNull() )
+ {
+ theErrorMsg = tr( "GUIDE_LINE_IS_NOT_SELECTED" );
+ return false;
+ }
+
+ myEditedObject->RemoveGuideLine();
myEditedObject->SetGuideLine( aGuideLine );
Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
+ if ( aProfile.IsNull() )
+ {
+ theErrorMsg = tr( "PROFILE_IS_NOT_SELECTED" );
+ return false;
+ }
+
+ myEditedObject->RemoveProfile();
myEditedObject->SetProfile( aProfile );
}
<source>DEFAULT_CHANNEL_NAME</source>
<translation>Channel</translation>
</message>
+ <message>
+ <source>GUIDE_LINE_IS_NOT_SELECTED</source>
+ <translation>Guide line is not chosen</translation>
+ </message>
+ <message>
+ <source>PROFILE_IS_NOT_SELECTED</source>
+ <translation>Profile is not chosen</translation>
+ </message>
</context>
-
<context>
<name>HYDROGUI_DigueDlg</name>
<message>