]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #555: now the error message appears if the guide line or profile are not selected
authorasl <asl@opencascade.com>
Wed, 27 May 2015 06:28:04 +0000 (09:28 +0300)
committerasl <asl@opencascade.com>
Wed, 27 May 2015 06:28:04 +0000 (09:28 +0300)
src/HYDROGUI/HYDROGUI_ChannelOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index d3acb739e14bff037b69c9c7c6888d61821c6283..f00d5804c1d847b70661f8ba8f19570b55bd2550 100644 (file)
@@ -181,19 +181,33 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
 
   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 );
   }
 
index f8b42f0ff41e81c65b4d6ceeedcd3fb727156326..807e8d70f7627b8af78afd6140c2507b3919dc04 100644 (file)
@@ -2170,8 +2170,15 @@ Polyline should consist from one not closed curve.</translation>
       <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>