From: asl Date: Thu, 29 Dec 2005 12:54:27 +0000 (+0000) Subject: PAL10035 - no warning if there is no rights to save X-Git-Tag: T_Before_Join_BR2-D5-38-2003~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d0d375dea1cc4a18b4bea4bbb2dbda3fadb962a0;p=modules%2Fkernel.git PAL10035 - no warning if there is no rights to save --- diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index 7c0844a31..de883d82e 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -695,13 +695,13 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin
See also an example of this method usage in batchmode of %SALOME application. */ - void Save(in Study aStudy, in boolean theMultiFile); + boolean Save(in Study aStudy, in boolean theMultiFile); /*! \brief Saving a study in a ASCII file (or files). Saves a study in an ASCII format file (or files). \param theMultiFile If this parameter is True the study will be saved in several files. */ - void SaveASCII(in Study aStudy, in boolean theMultiFile); + boolean SaveASCII(in Study aStudy, in boolean theMultiFile); /*! \brief Saving the study in a specified HDF file (or files). Saves the study in a specified file (or files). @@ -711,7 +711,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin
See also an example of this method usage in batchmode of %SALOME application. */ - void SaveAs(in URL aUrl, // if the file already exists + boolean SaveAs(in URL aUrl, // if the file already exists in Study aStudy, in boolean theMultiFile); // overwrite (as option) /*! \brief Saving the study in a specified ASCII file (or files). @@ -722,7 +722,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \param aStudy The study which will be saved \param theMultiFile If this parameter is True the study will be saved in several files. */ - void SaveAsASCII(in URL aUrl, // if the file already exists + boolean SaveAsASCII(in URL aUrl, // if the file already exists in Study aStudy, in boolean theMultiFile); // overwrite (as option) diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 21d2551cd..ec0137fb2 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -133,32 +133,32 @@ void SALOMEDS_StudyManager::Close(const _PTR(Study)& theStudy) _corba_impl->Close(aStudy); } -void SALOMEDS_StudyManager::Save(const _PTR(Study)& theStudy, bool theMultiFile) +bool SALOMEDS_StudyManager::Save(const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); - _corba_impl->Save(aStudy, theMultiFile); + return _corba_impl->Save(aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) +bool SALOMEDS_StudyManager::SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); - _corba_impl->SaveASCII(aStudy, theMultiFile); + return _corba_impl->SaveASCII(aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) +bool SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); - _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile); + return _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) +bool SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); - _corba_impl->SaveAsASCII((char*)theUrl.c_str(), aStudy, theMultiFile); + return _corba_impl->SaveAsASCII((char*)theUrl.c_str(), aStudy, theMultiFile); } std::vector SALOMEDS_StudyManager::GetOpenStudies() diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.hxx b/src/SALOMEDS/SALOMEDS_StudyManager.hxx index 853039564..8de05cf6f 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.hxx @@ -52,10 +52,10 @@ public: virtual _PTR(Study) NewStudy(const std::string& study_name); virtual _PTR(Study) Open(const std::string& theStudyUrl); virtual void Close(const _PTR(Study)& theStudy); - virtual void Save(const _PTR(Study)& theStudy, bool theMultiFile); - virtual void SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile); - virtual void SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile); - virtual void SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile); + virtual bool Save(const _PTR(Study)& theStudy, bool theMultiFile); + virtual bool SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile); + virtual bool SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile); + virtual bool SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile); virtual std::vector GetOpenStudies(); virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) ; virtual _PTR(Study) GetStudyByID(int theStudyID) ; diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index cb1a066ed..1bcaf8caa 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -207,30 +207,30 @@ void SALOMEDS_StudyManager_i::Close(SALOMEDS::Study_ptr aStudy) * Purpose : Save a Study to it's persistent reference */ //============================================================================ -void SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) +CORBA::Boolean SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) { SALOMEDS::Locker lock; if(aStudy->_is_nil()) { MESSAGE("Save error: Study is null"); - return; + return false; } Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId()); - _impl->Save(aStudyImpl, _factory, theMultiFile); + return _impl->Save(aStudyImpl, _factory, theMultiFile); } -void SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) +CORBA::Boolean SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) { SALOMEDS::Locker lock; if(aStudy->_is_nil()) { MESSAGE("SaveASCII error: Study is null"); - return; + return false; } Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId()); - _impl->SaveASCII(aStudyImpl, _factory, theMultiFile); + return _impl->SaveASCII(aStudyImpl, _factory, theMultiFile); } //============================================================================= @@ -238,30 +238,30 @@ void SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr aStudy, CORBA::Boole * Purpose : Save a study to the persistent reference aUrl */ //============================================================================ -void SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) +CORBA::Boolean SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) { SALOMEDS::Locker lock; if(aStudy->_is_nil()) { MESSAGE("SaveASCII error: Study is null"); - return; + return false; } Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId()); - _impl->SaveAs(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile); + return _impl->SaveAs(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile); } -void SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) +CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) { SALOMEDS::Locker lock; if(aStudy->_is_nil()) { MESSAGE("SaveASCII error: Study is null"); - return; + return false; } Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId()); - _impl->SaveAsASCII(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile); + return _impl->SaveAsASCII(TCollection_AsciiString((char*)aUrl), aStudyImpl, _factory, theMultiFile); } //============================================================================ diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx index 139cb86d3..ef428ed4c 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx @@ -100,17 +100,17 @@ public: /*! \param Study_ptr arguments */ - virtual void Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); + virtual CORBA::Boolean Save( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); - virtual void SaveASCII( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); + virtual CORBA::Boolean SaveASCII( SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); //! method to save a Study to the persistent reference aUrl /*! \param char* arguments, the new URL of the study \param Study_ptr arguments */ - virtual void SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); - virtual void SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); + virtual CORBA::Boolean SaveAs(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); + virtual CORBA::Boolean SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile); //! method to Get name list of open studies in the session /*! diff --git a/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx b/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx index 51e603cd8..1341fafcc 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx @@ -38,10 +38,10 @@ public: virtual _PTR(Study) NewStudy(const std::string& study_name) = 0; virtual _PTR(Study) Open(const std::string& theStudyUrl) = 0; virtual void Close(const _PTR(Study)& theStudy) = 0; - virtual void Save(const _PTR(Study)& theStudy, bool theMultiFile) = 0; - virtual void SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) = 0; - virtual void SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0; - virtual void SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0; + virtual bool Save(const _PTR(Study)& theStudy, bool theMultiFile) = 0; + virtual bool SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) = 0; + virtual bool SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0; + virtual bool SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) = 0; virtual std::vector GetOpenStudies() = 0; virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) = 0; virtual _PTR(Study) GetStudyByID(int theStudyID) = 0;