From 16038ba9e102276e819b8b105237e69973399b18 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 21 May 2014 17:15:46 +0400 Subject: [PATCH] Fix of the 22595 issue --- src/SalomeApp/SalomeApp_Study.cxx | 18 ++++++++++++++++-- src/SalomeApp/resources/SalomeApp_msg_en.ts | 8 ++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 8bb0ee178..70bd944cb 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -466,10 +466,17 @@ bool SalomeApp_Study::createDocument( const QString& theStr ) try { study = _PTR(Study)( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) ); } + catch(const SALOME_Exception& ex) { + SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), + tr("ERR_ERROR"), tr(ex.what())); + return false; + } catch(...) { SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), - tr("ERR_ERROR"), tr("ERR_ACTIVE_STUDY_CREATE") ); + tr("ERR_ERROR"), tr("CREATE_DOCUMENT_PROBLEM")); + return false; } + if ( !study ) return false; @@ -509,10 +516,17 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) try { study = _PTR(Study) ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) ); } + catch(const SALOME_Exception& ex) { + SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), + tr("ERR_ERROR"), tr(ex.what())); + return false; + } catch(...) { SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), - tr("ERR_ERROR"), tr("ERR_ACTIVE_STUDY_OPEN") ); + tr("ERR_ERROR"), tr("OPEN_DOCUMENT_PROBLEM")); + return false; } + if ( !study ) return false; diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.ts b/src/SalomeApp/resources/SalomeApp_msg_en.ts index 16e1ae5b5..af08eef16 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.ts +++ b/src/SalomeApp/resources/SalomeApp_msg_en.ts @@ -110,6 +110,14 @@ Launch a new session or close the study. Cannot open study: there is already an active study in this session. Launch a new session or close the study. + + OPEN_DOCUMENT_PROBLEM + Unknown problem during opening of the document + + + CREATE_DOCUMENT_PROBLEM + Unknown problem during creation of the document + SalomeApp_Application -- 2.39.2