X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageOp.cxx;h=d68840a8b22a5026b0a4858622e89a91a08861ca;hb=d6e19029f8b41f295db878e9aecf451c2edda4af;hp=a3d2c72e040aaed1a8d230cd4604687abf75e997;hpb=439579ec24edd8b147cab07f688d446d59029a1e;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index a3d2c72e..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 ) ) { @@ -509,14 +522,23 @@ bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags, if ( isApplyAndClose() ) theUpdateFlags |= UF_Viewer | UF_GV_Forced | UF_OCCViewer | UF_OCC_Forced; + if( isApplyAndClose() ) + { + commitDocOperation(); // to save the modifications in the data model + return true; + } if( SetNextFile() ) { theErrorMsg = ""; - commitDocOperation(); // to save the modifications in the data model + module()->updateObjBrowser(); return false; // and to continue the operation } + /*if( myFiles.count() > 1 ) + { + setIsApplyAndClose( true ); + }*/ return true; }