From 243d0b3bd772e9d202c07f65839d0975faa6c655 Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 27 May 2015 16:47:40 +0300 Subject: [PATCH] refs #556: warning when image file is not chosen --- src/HYDROGUI/HYDROGUI_ImportImageOp.cxx | 13 +++++++++++++ src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index bf837ade..d68840a8 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -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 ) ) { diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 807e8d70..885092d9 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -674,6 +674,14 @@ Would you like to remove all references from the image? CANT_LOAD_GEOREFERENCEMENT_FILE Can't load data from the image georeferencement file. + + SELECT_IMAGE_NAME + The image name is not input + + + SELECT_IMAGE_FILE + The image file is not chosen + -- 2.39.2