From: rkv Date: Mon, 11 Nov 2013 10:48:16 +0000 (+0000) Subject: Fix for the bug #37: Error when import image with format not supported. X-Git-Tag: BR_hydro_v_0_3~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=48a27c798fd1c130ffe82283d89b72b129aa2318;p=modules%2Fhydro.git Fix for the bug #37: Error when import image with format not supported. --- diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx index c31cbdb6..862876e6 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx @@ -24,12 +24,16 @@ #include "HYDROGUI_PrsImage.h" #include "HYDROGUI_Tool.h" +#include "HYDROGUI_Module.h" #include #include +#include #include #include +#include +#include #include #include @@ -605,7 +609,14 @@ void HYDROGUI_ImportImageDlg::onBrowse() if( !aFileName.isEmpty() ) { QImage anImage( aFileName ); - if( !anImage.isNull() ) + if( anImage.isNull() ) + { + QString aTitle = QObject::tr( "INPUT_VALID_DATA" ); + QString aMessage = QObject::tr( "FILE_CAN_NOT_BE_IMPORTED" ). + arg( aFileName ).arg( QFileInfo( aFileName ).suffix() ); + SUIT_MessageBox::warning( module()->getApp()->desktop(), aTitle, aMessage ); + } + else { myFileName->setText( aFileName ); emit createPreview( anImage ); diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index bb8bf240..e2fcf529 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -15,6 +15,10 @@ CASE_REGIONS Regions + + FILE_CAN_NOT_BE_IMPORTED + The file '%1' can not be imported: format *.%2 is not supported. + FILE_NOT_EXISTS_OR_CANT_BE_READ The file '%1'