- // initialize myStudyDS, read HDF file
- QString aName = newStudyName();
-
- _PTR(Study) study;
- bool showError = !application()->property("open_study_from_command_line").isValid() ||
- !application()->property("open_study_from_command_line").toBool();
- try {
- study = _PTR(Study)( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) );
- }
- catch(const SALOME_Exception& ex) {
- application()->putInfo(tr(ex.what()));
- if ( showError )
- SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
- tr("ERR_ERROR"), tr(ex.what()));
- return false;
- }
- catch(...) {
- application()->putInfo(tr("CREATE_DOCUMENT_PROBLEM"));
- if ( showError )
- SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
- tr("ERR_ERROR"), tr("CREATE_DOCUMENT_PROBLEM"));
- return false;
- }
-
- if ( !study )
- return false;
-
- setStudyDS( study );
- setStudyName( aName );