From 6cbdd65fdc8d35fac60477b329512406c4e5061d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 3 May 2006 13:36:34 +0000 Subject: [PATCH] fix bug 11933. Adaptation of the script produced by DumpPython functionality to TUI mode execution: "salome.salome_init()" added --- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index ff3b3112e..6233ac81c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -1301,8 +1301,11 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, //set sys.path and add a creation of the study. fp << GetDumpStudyComment().ToCString() << endl << endl; fp << "import sys" << endl; - fp << "import " << aBatchModeScript << "\n" << endl; - fp << "sys.path.insert( 0, \'" << thePath << "\')\n" << endl; + fp << "import " << aBatchModeScript << endl << endl; + + fp << aBatchModeScript << ".salome_init()" << endl << endl; + + fp << "sys.path.insert( 0, \'" << thePath << "\')" << endl << endl; //Check if it's necessary to dump visual parameters @@ -1311,8 +1314,7 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, if(isDumpVisuals) { lastSavePoint = SALOMEDSImpl_IParameters::getLastSavePoint(this); if(lastSavePoint > 0) { - fp << SALOMEDSImpl_IParameters::getStudyScript(this, lastSavePoint); - fp << "\n" << endl; + fp << SALOMEDSImpl_IParameters::getStudyScript(this, lastSavePoint) << endl << endl; } } @@ -1337,12 +1339,10 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, if (aDriver != NULL) { Handle(SALOMEDSImpl_StudyBuilder) SB = NewBuilder(); - cout << "Before SB" << endl; if(!SB->LoadWith(sco, aDriver)) { _errorCode = SB->GetErrorCode(); return false; } - cout << "After SB" << endl; } else continue; } @@ -1401,11 +1401,14 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, fp << aScriptName << ".RebuildData(" << aBatchModeScript << ".myStudy)" << endl; } + fp << endl; + fp << "if salome.sg.hasDesktop():" << endl; + fp << "\tsalome.sg.updateObjBrowser(1)" << endl; + if(isDumpVisuals) { //Output the call to Session's method restoreVisualState - fp << "iparameters.getSession().restoreVisualState(1)" << endl; + fp << "\tiparameters.getSession().restoreVisualState(1)" << endl; } - fp << "salome.sg.updateObjBrowser(1)" << endl; fp.close(); return isOk; -- 2.39.2