#include <SUIT_ResourceMgr.h>
#include <SUIT_TreeModel.h>
#include <SUIT_DataBrowser.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
#include <LightApp_Displayer.h>
// initialize myStudyDS, read HDF file
QString aName = newStudyName();
- _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) );
+
+ _PTR(Study) study;
+ try {
+ study = _PTR(Study)( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) );
+ }
+ catch(...) {
+ SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
+ tr("ERR_ERROR"), tr("ERR_ACTIVE_STUDY_CREATE") );
+ }
if ( !study )
return false;
MESSAGE( "openDocument" );
// initialize myStudyDS, read HDF file
- _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) );
+ _PTR(Study) study;
+ try {
+ study = _PTR(Study) ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) );
+ }
+ catch(...) {
+ SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
+ tr("ERR_ERROR"), tr("ERR_ACTIVE_STUDY_OPEN") );
+ }
if ( !study )
return false;
<source>ERR_NO_VARIABLE</source>
<translation>Variable with name "%1" doesn't exist</translation>
</message>
+ <message>
+ <source>ERR_ACTIVE_STUDY_CREATE</source>
+ <translation>Cannot create study: there is already an active study in this session.
+Launch a new session or close the study.</translation>
+ </message>
+ <message>
+ <source>ERR_ACTIVE_STUDY_OPEN</source>
+ <translation>Cannot open study: there is already an active study in this session.
+Launch a new session or close the study.</translation>
+ </message>
</context>
<context>
<name>SalomeApp_Application</name>
<source>ERR_NO_VARIABLE</source>
<translation>La variable "%1" n'existe pas.</translation>
</message>
+ <message>
+ <source>ERR_ACTIVE_STUDY_CREATE</source>
+ <translation type="unfinished">Cannot create study: there is already an active study in this session.
+Launch a new session or close the study.</translation>
+ </message>
+ <message>
+ <source>ERR_ACTIVE_STUDY_OPEN</source>
+ <translation type="unfinished">Cannot open study: there is already an active study in this session.
+Launch a new session or close the study.</translation>
+ </message>
</context>
<context>
<name>SalomeApp_Application</name>
<source>ERR_NO_VARIABLE</source>
<translation>変数"%1"は存在しません。</translation>
</message>
+ <message>
+ <source>ERR_ACTIVE_STUDY_CREATE</source>
+ <translation type="unfinished">Cannot create study: there is already an active study in this session.
+Launch a new session or close the study.</translation>
+ </message>
+ <message>
+ <source>ERR_ACTIVE_STUDY_OPEN</source>
+ <translation type="unfinished">Cannot open study: there is already an active study in this session.
+Launch a new session or close the study.</translation>
+ </message>
</context>
<context>
<name>SalomeApp_Application</name>