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;
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;
<translation>Cannot open study: there is already an active study in this session.
Launch a new session or close the study.</translation>
</message>
+ <message>
+ <source>OPEN_DOCUMENT_PROBLEM</source>
+ <translation>Unknown problem during opening of the document</translation>
+ </message>
+ <message>
+ <source>CREATE_DOCUMENT_PROBLEM</source>
+ <translation>Unknown problem during creation of the document</translation>
+ </message>
</context>
<context>
<name>SalomeApp_Application</name>