From f864c284906b63bc88636850e33117c679e4a29b Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 25 Jul 2005 04:26:49 +0000 Subject: [PATCH] now study uses resources "multi_file" and "ascii_file" during document saving --- src/SalomeApp/SalomeApp_Study.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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 ); -- 2.39.2