#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
+//---------------------------------------------------------
+#define USE_DEBUG
+//#define MB_IGNORE_QT
+//#define MB_FULL_DUMP
+#define MBCLASSNAME "SalomeApp_Study"
+#include "MBDebug.h"
+// <-- insert includes for addtional debug headers here!
+//---------------------------------------------------------
+
//#define NOTIFY_BY_EVENT
class ObserverEvent : public QEvent
SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
: LightApp_Study( app ), myObserver( 0 )
{
+ DBG_FUN();
myStudyDS = SalomeApp_Application::getStudy();
}
*/
SalomeApp_Study::~SalomeApp_Study()
{
+ DBG_FUN();
if ( myObserver ) {
PortableServer::ObjectId_var oid = myObserver->_default_POA()->servant_to_id( myObserver );
myObserver->_default_POA()->deactivate_object( oid.in() );
*/
bool SalomeApp_Study::createDocument( const QString& theStr )
{
+ DBG_FUN();
+ ARG(theStr);
MESSAGE( "createDocument" );
setStudyName( QString::fromUtf8(myStudyDS->URL().c_str()) );
*/
bool SalomeApp_Study::openDocument( const QString& theFileName )
{
+ DBG_FUN();
+ ARG(theFileName);
MESSAGE( "openDocument" );
// read HDF file
*/
bool SalomeApp_Study::loadDocument( const QString& theStudyName )
{
+ DBG_FUN();
+ ARG(theStudyName);
MESSAGE( "loadDocument" );
setRoot( new SalomeApp_RootObject( this ) ); // create myRoot
Saves document
\param theFileName - name of file
*/
-bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
+bool SalomeApp_Study::saveDocumentAs( const QString& theFileName, bool isBackup/*=false*/ )
{
+ DBG_FUN();
+ ARG(theFileName);
+ ARG(isBackup);
+
bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", false );
- if ( store )
+ if ( store && !isBackup )
SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
ModelList list; dataModels( list );
if ( LightApp_DataModel* aModel =
dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
listOfFiles.clear();
- aModel->saveAs( theFileName, this, listOfFiles );
+ aModel->saveAs( theFileName, this, listOfFiles, isBackup );
if ( !listOfFiles.isEmpty() )
saveModuleData(aModel->module()->name(), 0, // 0 means persistence file
listOfFiles);
res = res && saveStudyData(theFileName, 0); // 0 means persistence file
- if ( res )
+ if ( res && !isBackup)
emit saved( this );
return res;
*/
bool SalomeApp_Study::saveDocument()
{
+ DBG_FUN();
bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true );
if ( store )
SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
*/
void SalomeApp_Study::closeDocument(bool permanently)
{
+ DBG_FUN();
LightApp_Study::closeDocument(permanently);
// close SALOMEDS document
bool isMultiFile,
bool toSaveGUI )
{
+ DBG_FUN();
+ ARG(theFileName);
+ ARG(toPublish);
+ ARG(isMultiFile);
+ ARG(toSaveGUI);
int savePoint = 0;
_PTR(AttributeParameter) ap;
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);