]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #556: warning when image file is not chosen
authorasl <asl@opencascade.com>
Wed, 27 May 2015 13:47:40 +0000 (16:47 +0300)
committerasl <asl@opencascade.com>
Wed, 27 May 2015 13:47:40 +0000 (16:47 +0300)
src/HYDROGUI/HYDROGUI_ImportImageOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index bf837ade79e883bcac198a7b6be658d5d2aa1fab..d68840a8b22a5026b0a4858622e89a91a08861ca 100644 (file)
@@ -350,9 +350,22 @@ bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags,
 {
   HYDROGUI_ImportImageDlg* aPanel = (HYDROGUI_ImportImageDlg*)inputPanel();
 
+  if( !myIsEdit )
+  {
+    QString aFilePath = aPanel->getFileName();
+    if( aFilePath.isEmpty() )
+    {
+      theErrorMsg = tr( "SELECT_IMAGE_FILE" ).arg( aFilePath );
+      return false;
+    }
+  }
+
   QString anImageName = aPanel->getImageName();
   if( anImageName.isEmpty() )
+  {
+    theErrorMsg = tr( "SELECT_IMAGE_NAME" ).arg( anImageName );
     return false;
+  }
 
   if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anImageName ) )
   {
index 807e8d70f7627b8af78afd6140c2507b3919dc04..885092d94391c0dcf769779308f98ea0e7ead481 100644 (file)
@@ -674,6 +674,14 @@ Would you like to remove all references from the image?</translation>
       <source>CANT_LOAD_GEOREFERENCEMENT_FILE</source>
       <translation>Can't load data from the image georeferencement file.</translation>
     </message>
+    <message>
+      <source>SELECT_IMAGE_NAME</source>
+      <translation>The image name is not input</translation>
+    </message>
+    <message>
+      <source>SELECT_IMAGE_FILE</source>
+      <translation>The image file is not chosen</translation>
+    </message>
   </context>
   
   <context>