From: mgn Date: Wed, 6 May 2015 11:39:11 +0000 (+0300) Subject: 0002760: External 20786 (Bug) Most recently used X-Git-Tag: CTH_2_1_a~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f6af99d883ef337e65facc12fb0d30da039d231b;p=modules%2Fgui.git 0002760: External 20786 (Bug) Most recently used --- diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index ec1e7b2ab..96ac8dc86 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include /*!Create and return new instance of STD_Application*/ @@ -321,9 +322,18 @@ void STD_Application::onOpenDoc() /*! \retval true, if document was opened successful, else false.*/ bool STD_Application::onOpenDoc( const QString& aName ) { + bool res = false; + + if ( !QFileInfo( aName ).exists() ) + { + SUIT_MessageBox::critical( desktop(), tr( "ERR_ERROR" ), + tr( "MSG_FILE_NOT_EXISTS" ).arg( aName ) ); + return res; + } + QApplication::setOverrideCursor( Qt::WaitCursor ); - bool res = openAction( openChoice( aName ), aName ); + res = openAction( openChoice( aName ), aName ); QApplication::restoreOverrideCursor(); diff --git a/src/STD/resources/STD_msg_en.ts b/src/STD/resources/STD_msg_en.ts index e619c05e1..46b4f0984 100644 --- a/src/STD/resources/STD_msg_en.ts +++ b/src/STD/resources/STD_msg_en.ts @@ -463,5 +463,12 @@ Do you want to save changes? CLOSE_QUESTION Do you want to save study before closing? + + MSG_FILE_NOT_EXISTS + + Most recent file cannot be loaded. + File "%1" not exists. + +