From f6af99d883ef337e65facc12fb0d30da039d231b Mon Sep 17 00:00:00 2001 From: mgn Date: Wed, 6 May 2015 14:39:11 +0300 Subject: [PATCH] 0002760: External 20786 (Bug) Most recently used --- src/STD/STD_Application.cxx | 12 +++++++++++- src/STD/resources/STD_msg_en.ts | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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. + + -- 2.39.2