From: asl Date: Mon, 25 Jul 2005 04:26:49 +0000 (+0000) Subject: now study uses resources "multi_file" and "ascii_file" during document saving X-Git-Tag: V3_0_1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f864c284906b63bc88636850e33117c679e4a29b;p=modules%2Fgui.git now study uses resources "multi_file" and "ascii_file" during document saving --- diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index aa1487796..539412f9d 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -140,9 +140,14 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) aModel->saveAs( theFileName, this ); // save SALOMEDS document - bool isMultiFile = false, isAscii = false;// TODO: This information should be taken from preferences afterwards! - /* bool res = */isAscii ? SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.latin1(), studyDS(), isMultiFile ) : - SalomeApp_Application::studyMgr()->SaveAs ( theFileName.latin1(), studyDS(), isMultiFile ); + SUIT_ResourceMgr* resMgr = application()->resourceMgr(); + if( !resMgr ) + return false; + + bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ), + isAscii = resMgr->booleanValue( "Study", "ascii_file", true ); + isAscii ? SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.latin1(), studyDS(), isMultiFile ) : + SalomeApp_Application::studyMgr()->SaveAs ( theFileName.latin1(), studyDS(), isMultiFile ); bool res = CAM_Study::saveDocumentAs( theFileName ); //SRN: BugID IPAL9377, removed usage of uninitialized variable @@ -167,7 +172,12 @@ void SalomeApp_Study::saveDocument() CAM_Study::saveDocument(); // save SALOMEDS document - bool isMultiFile = false, isAscii = false;// TODO: This information should be taken from preferences afterwards! + SUIT_ResourceMgr* resMgr = application()->resourceMgr(); + if( !resMgr ) + return; + + bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ), + isAscii = resMgr->booleanValue( "Study", "ascii_file", true ); isAscii ? SalomeApp_Application::studyMgr()->SaveASCII( studyDS(), isMultiFile ) : SalomeApp_Application::studyMgr()->Save ( studyDS(), isMultiFile );