Salome HOME
projects
/
modules
/
gui.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ebd708c
)
[bos#35161][EDF](2023-T1) Automatic backup - initial commit
author
mbs
<martin.bernhard@opencascade.com>
Sat, 9 Dec 2023 22:21:12 +0000
(22:21 +0000)
committer
mbs
<martin.bernhard@opencascade.com>
Fri, 19 Jan 2024 23:08:16 +0000
(23:08 +0000)
src/LightApp/LightApp_Application.cxx
patch
|
blob
|
history
src/LightApp/LightApp_DataModel.cxx
patch
|
blob
|
history
src/LightApp/LightApp_DataModel.h
patch
|
blob
|
history
src/LightApp/LightApp_Study.cxx
patch
|
blob
|
history
src/LightApp/LightApp_Study.h
patch
|
blob
|
history
src/SUIT/SUIT_Study.cxx
patch
|
blob
|
history
src/SUIT/SUIT_Study.h
patch
|
blob
|
history
src/SalomeApp/SalomeApp_Study.cxx
patch
|
blob
|
history
src/SalomeApp/SalomeApp_Study.h
patch
|
blob
|
history
diff --git
a/src/LightApp/LightApp_Application.cxx
b/src/LightApp/LightApp_Application.cxx
index f14da6ff25ccff976d5d3159a9e5b720601da95f..7be6a4c19d412294c21b3f8def6d0e53e3c21317 100644
(file)
--- a/
src/LightApp/LightApp_Application.cxx
+++ b/
src/LightApp/LightApp_Application.cxx
@@
-224,6
+224,15
@@
#include <Standard_Version.hxx>
#include <Standard_Version.hxx>
+//---------------------------------------------------------
+#define USE_DEBUG
+//#define MB_IGNORE_QT
+//#define MB_FULL_DUMP
+#define MBCLASSNAME "LightApp_Application"
+#include "MBDebug.h"
+// <-- insert includes for addtional debug headers here!
+//---------------------------------------------------------
+
#define ToolBarMarker 0
#define DockWidgetMarker 1
#define ToolBarMarker 0
#define DockWidgetMarker 1
@@
-373,6
+382,7
@@
LightApp_Application::LightApp_Application()
myPrefs( 0 ),
myScreenHelper(new LightApp_FullScreenHelper())
{
myPrefs( 0 ),
myScreenHelper(new LightApp_FullScreenHelper())
{
+ DBG_FUN();
Q_INIT_RESOURCE( LightApp );
STD_TabDesktop* desk = new STD_TabDesktop();
Q_INIT_RESOURCE( LightApp );
STD_TabDesktop* desk = new STD_TabDesktop();
@@
-485,6
+495,7
@@
LightApp_Application::LightApp_Application()
*/
LightApp_Application::~LightApp_Application()
{
*/
LightApp_Application::~LightApp_Application()
{
+ DBG_FUN();
savePreferences();
delete mySelMgr;
delete myScreenHelper;
savePreferences();
delete mySelMgr;
delete myScreenHelper;
@@
-494,6
+505,7
@@
LightApp_Application::~LightApp_Application()
/*!Start application.*/
void LightApp_Application::start()
{
/*!Start application.*/
void LightApp_Application::start()
{
+ DBG_FUN();
CAM_Application::start();
updateWindows();
CAM_Application::start();
updateWindows();
@@
-511,6
+523,7
@@
void LightApp_Application::start()
/*!Closeapplication.*/
void LightApp_Application::closeApplication()
{
/*!Closeapplication.*/
void LightApp_Application::closeApplication()
{
+ DBG_FUN();
#ifndef DISABLE_QTXWEBBROWSER
QProcess::startDetached( "HelpBrowser",
QStringList() << QString( "--remove=%1" ).arg( QApplication::instance()->applicationPid() ) );
#ifndef DISABLE_QTXWEBBROWSER
QProcess::startDetached( "HelpBrowser",
QStringList() << QString( "--remove=%1" ).arg( QApplication::instance()->applicationPid() ) );
@@
-2219,6
+2232,7
@@
void LightApp_Application::onStudyCreated( SUIT_Study* theStudy )
*/
void LightApp_Application::onStudyOpened( SUIT_Study* theStudy )
{
*/
void LightApp_Application::onStudyOpened( SUIT_Study* theStudy )
{
+ DBG_FUN();
SUIT_DataObject* aRoot = 0;
if ( theStudy && theStudy->root() )
{
SUIT_DataObject* aRoot = 0;
if ( theStudy && theStudy->root() )
{
@@
-2250,9
+2264,12
@@
void LightApp_Application::onStudyOpened( SUIT_Study* theStudy )
/*!Protected SLOT. On study saved.*/
void LightApp_Application::onStudySaved( SUIT_Study* s )
{
/*!Protected SLOT. On study saved.*/
void LightApp_Application::onStudySaved( SUIT_Study* s )
{
+ DBG_FUN();
QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
- if ( mru && s )
+ if ( mru && s ) {
+ MSGEL("...adding [" << s->studyName().toStdString() << "] to MRU");
mru->insert( s->studyName() );
mru->insert( s->studyName() );
+ }
emit studySaved();
}
emit studySaved();
}
@@
-2260,6
+2277,7
@@
void LightApp_Application::onStudySaved( SUIT_Study* s )
/*!Protected SLOT. On study closed.*/
void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ )
{
/*!Protected SLOT. On study closed.*/
void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ )
{
+ DBG_FUN();
/*
disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
/*
disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
@@
-2288,6
+2306,7
@@
void LightApp_Application::onDesktopActivated()
void LightApp_Application::studyOpened( SUIT_Study* s )
{
void LightApp_Application::studyOpened( SUIT_Study* s )
{
+ DBG_FUN();
CAM_Application::studyOpened( s );
updateWindows();
CAM_Application::studyOpened( s );
updateWindows();
@@
-2296,6
+2315,7
@@
void LightApp_Application::studyOpened( SUIT_Study* s )
void LightApp_Application::studySaved( SUIT_Study* s )
{
void LightApp_Application::studySaved( SUIT_Study* s )
{
+ DBG_FUN();
CAM_Application::studyOpened( s );
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
if ( aResMgr && activeStudy() ) {
CAM_Application::studyOpened( s );
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
if ( aResMgr && activeStudy() ) {
@@
-4971,6
+4991,8
@@
void LightApp_Application::onWCDestroyed( QObject* ob )
void LightApp_Application::onMRUActivated( const QString& name )
{
void LightApp_Application::onMRUActivated( const QString& name )
{
+ DBG_FUN();
+ ARG(name);
SUIT_Session* s = SUIT_Session::session();
if ( s && s->activeApplication() == this )
onOpenDoc( name );
SUIT_Session* s = SUIT_Session::session();
if ( s && s->activeApplication() == this )
onOpenDoc( name );
diff --git
a/src/LightApp/LightApp_DataModel.cxx
b/src/LightApp/LightApp_DataModel.cxx
index 2729b4d5a94e4cb346c7269463875112542e3844..e057671aac23cc9d08eea90ed24674ddf883831b 100644
(file)
--- a/
src/LightApp/LightApp_DataModel.cxx
+++ b/
src/LightApp/LightApp_DataModel.cxx
@@
-34,12
+34,22
@@
#include <SUIT_DataBrowser.h>
#include <SUIT_DataObject.h>
#include <SUIT_DataBrowser.h>
#include <SUIT_DataObject.h>
+//---------------------------------------------------------
+#define USE_DEBUG
+//#define MB_IGNORE_QT
+//#define MB_FULL_DUMP
+#define MBCLASSNAME "LightApp_DataModel"
+#include "MBDebug.h"
+// <-- insert includes for addtional debug headers here!
+//---------------------------------------------------------
+
/*!
Constructor
*/
LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule )
: CAM_DataModel( theModule )
{
/*!
Constructor
*/
LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule )
: CAM_DataModel( theModule )
{
+ DBG_FUN();
myGroupId = 0;
if( module() )
myGroupId = qHash( module()->name() );
myGroupId = 0;
if( module() )
myGroupId = qHash( module()->name() );
@@
-50,6
+60,7
@@
LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule )
*/
LightApp_DataModel::~LightApp_DataModel()
{
*/
LightApp_DataModel::~LightApp_DataModel()
{
+ DBG_FUN();
}
/*!
}
/*!
@@
-57,6
+68,7
@@
LightApp_DataModel::~LightApp_DataModel()
*/
bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList )
{
*/
bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList )
{
+ DBG_FUN();
emit opened(); //TODO: is it really needed? to be removed maybe...
return true;
}
emit opened(); //TODO: is it really needed? to be removed maybe...
return true;
}
@@
-66,6
+78,7
@@
bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList )
*/
bool LightApp_DataModel::save( QStringList& )
{
*/
bool LightApp_DataModel::save( QStringList& )
{
+ DBG_FUN();
emit saved();
return true;
}
emit saved();
return true;
}
@@
-73,9
+86,12
@@
bool LightApp_DataModel::save( QStringList& )
/*!
Emit saved()
*/
/*!
Emit saved()
*/
-bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList& )
+bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList&
, bool isBackup/*=false*/
)
{
{
- emit saved();
+ DBG_FUN();
+ ARG(isBackup);
+ if (!isBackup)
+ emit saved();
return true;
}
return true;
}
@@
-93,6
+109,7
@@
bool LightApp_DataModel::dumpPython( const QString&, CAM_Study*, bool, QStringLi
*/
bool LightApp_DataModel::close()
{
*/
bool LightApp_DataModel::close()
{
+ DBG_FUN();
emit closed();
return true;
}
emit closed();
return true;
}
@@
-119,6
+136,7
@@
void LightApp_DataModel::updateWidgets()
*/
void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
{
*/
void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
{
+ DBG_FUN();
// san: Previously modelRoot was casted to LightApp_ModuleObject*,
// BUT this is incorrect: in full SALOME the model root has different type.
// Hopefully LightApp_DataObject* is sufficient here.
// san: Previously modelRoot was casted to LightApp_ModuleObject*,
// BUT this is incorrect: in full SALOME the model root has different type.
// Hopefully LightApp_DataObject* is sufficient here.
diff --git
a/src/LightApp/LightApp_DataModel.h
b/src/LightApp/LightApp_DataModel.h
index 98f9d71aa574965f5518af6dc6ec8b5d97b5221d..23d2c29e65a74eb81fce504abe1e38258a052d73 100644
(file)
--- a/
src/LightApp/LightApp_DataModel.h
+++ b/
src/LightApp/LightApp_DataModel.h
@@
-53,7
+53,7
@@
public:
virtual bool open( const QString&, CAM_Study*, QStringList );
virtual bool save( QStringList& );
virtual bool open( const QString&, CAM_Study*, QStringList );
virtual bool save( QStringList& );
- virtual bool saveAs( const QString&, CAM_Study*, QStringList& );
+ virtual bool saveAs( const QString&, CAM_Study*, QStringList&
, bool isBackup=false
);
virtual bool close();
virtual bool dumpPython( const QString&,
CAM_Study*,
virtual bool close();
virtual bool dumpPython( const QString&,
CAM_Study*,
diff --git
a/src/LightApp/LightApp_Study.cxx
b/src/LightApp/LightApp_Study.cxx
index 222b2ae04f35963dddc4b77aa29f66274369864d..b08fd5d3e06beb19440786eac1ff8da25e625d13 100644
(file)
--- a/
src/LightApp/LightApp_Study.cxx
+++ b/
src/LightApp/LightApp_Study.cxx
@@
-36,12
+36,22
@@
#include <set>
#include <set>
+//---------------------------------------------------------
+#define USE_DEBUG
+//#define MB_IGNORE_QT
+//#define MB_FULL_DUMP
+#define MBCLASSNAME "LightApp_Study"
+#include "MBDebug.h"
+// <-- insert includes for addtional debug headers here!
+//---------------------------------------------------------
+
/*!
Constructor.
*/
LightApp_Study::LightApp_Study( SUIT_Application* app )
: CAM_Study( app )
{
/*!
Constructor.
*/
LightApp_Study::LightApp_Study( SUIT_Application* app )
: CAM_Study( app )
{
+ DBG_FUN();
// HDF persistence
myDriver = new LightApp_HDFDriver();
//myDriver = new LightApp_Driver();
// HDF persistence
myDriver = new LightApp_HDFDriver();
//myDriver = new LightApp_Driver();
@@
-52,6
+62,7
@@
LightApp_Study::LightApp_Study( SUIT_Application* app )
*/
LightApp_Study::~LightApp_Study()
{
*/
LightApp_Study::~LightApp_Study()
{
+ DBG_FUN();
delete myDriver; myDriver = 0;
}
delete myDriver; myDriver = 0;
}
@@
-60,6
+71,8
@@
LightApp_Study::~LightApp_Study()
*/
bool LightApp_Study::createDocument( const QString& theStr )
{
*/
bool LightApp_Study::createDocument( const QString& theStr )
{
+ DBG_FUN();
+ ARG(theStr);
// create myRoot
setRoot( new LightApp_RootObject( this ) );
// create myRoot
setRoot( new LightApp_RootObject( this ) );
@@
-75,6
+88,8
@@
bool LightApp_Study::createDocument( const QString& theStr )
*/
bool LightApp_Study::openDocument( const QString& theFileName )
{
*/
bool LightApp_Study::openDocument( const QString& theFileName )
{
+ DBG_FUN();
+ ARG(theFileName);
myDriver->ClearDriverContents();
// create files for models from theFileName
if( !openStudyData(theFileName, 0)) // 0 means persistence file
myDriver->ClearDriverContents();
// create files for models from theFileName
if( !openStudyData(theFileName, 0)) // 0 means persistence file
@@
-104,6
+119,8
@@
bool LightApp_Study::openDocument( const QString& theFileName )
*/
bool LightApp_Study::loadDocument( const QString& theStudyName )
{
*/
bool LightApp_Study::loadDocument( const QString& theStudyName )
{
+ DBG_FUN();
+ ARG(theStudyName);
myDriver->ClearDriverContents();
if( !openStudyData(theStudyName, 0)) // 0 means persistence file
return false;
myDriver->ClearDriverContents();
if( !openStudyData(theStudyName, 0)) // 0 means persistence file
return false;
@@
-134,8
+151,11
@@
bool LightApp_Study::loadDocument( const QString& theStudyName )
/*!
Saves document
*/
/*!
Saves document
*/
-bool LightApp_Study::saveDocumentAs( const QString& theFileName )
+bool LightApp_Study::saveDocumentAs( const QString& theFileName
, bool isBackup/*=false*/
)
{
{
+ DBG_FUN();
+ ARG(theFileName);
+ ARG(isBackup);
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
if( !resMgr )
return false;
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
if( !resMgr )
return false;
@@
-190,7
+210,7
@@
bool LightApp_Study::saveDocumentAs( const QString& theFileName )
bool res = saveStudyData(theFileName, 0); // 0 means persistence file
res = res && CAM_Study::saveDocumentAs( theFileName );
//SRN: BugID IPAL9377, removed usage of uninitialized variable <res>
bool res = saveStudyData(theFileName, 0); // 0 means persistence file
res = res && CAM_Study::saveDocumentAs( theFileName );
//SRN: BugID IPAL9377, removed usage of uninitialized variable <res>
- if ( res )
+ if ( res
&& !isBackup
)
emit saved( this );
return res;
emit saved( this );
return res;
@@
-201,6
+221,7
@@
bool LightApp_Study::saveDocumentAs( const QString& theFileName )
*/
bool LightApp_Study::saveDocument()
{
*/
bool LightApp_Study::saveDocument()
{
+ DBG_FUN();
ModelList list; dataModels( list );
myDriver->ClearDriverContents();
ModelList list; dataModels( list );
myDriver->ClearDriverContents();
@@
-229,6
+250,8
@@
bool LightApp_Study::saveDocument()
*/
void LightApp_Study::closeDocument(bool permanently)
{
*/
void LightApp_Study::closeDocument(bool permanently)
{
+ DBG_FUN();
+ ARG(permanently);
// Inform everybody that this study is going to close when it's most safe to,
// i.e. in the very beginning
emit closed( this );
// Inform everybody that this study is going to close when it's most safe to,
// i.e. in the very beginning
emit closed( this );
@@
-328,6
+351,10
@@
void LightApp_Study::addComponent(const CAM_DataModel* /*dm*/)
*/
void LightApp_Study::saveModuleData(QString theModuleName, int type, QStringList theListOfFiles)
{
*/
void LightApp_Study::saveModuleData(QString theModuleName, int type, QStringList theListOfFiles)
{
+ DBG_FUN();
+ ARG(theModuleName);
+ ARG(type);
+ ARG(theListOfFiles);
int aNb = theListOfFiles.count();
if ( aNb == 0 )
return;
int aNb = theListOfFiles.count();
if ( aNb == 0 )
return;
@@
-364,6
+391,8
@@
void LightApp_Study::openModuleData(QString theModuleName, int /*type*/, QString
*/
bool LightApp_Study::saveStudyData( const QString& theFileName, int /*type*/ )
{
*/
bool LightApp_Study::saveStudyData( const QString& theFileName, int /*type*/ )
{
+ DBG_FUN();
+ ARG(theFileName);
ModelList list; dataModels( list );
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
if( !resMgr )
ModelList list; dataModels( list );
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
if( !resMgr )
diff --git
a/src/LightApp/LightApp_Study.h
b/src/LightApp/LightApp_Study.h
index 1569d467dac758434a3a24c631181d1b04895d51..d3a5ca953951f4683537b356afcf30fd6d4423cf 100644
(file)
--- a/
src/LightApp/LightApp_Study.h
+++ b/
src/LightApp/LightApp_Study.h
@@
-76,10
+76,12
@@
public:
virtual bool loadDocument( const QString& );
virtual bool saveDocument();
virtual bool loadDocument( const QString& );
virtual bool saveDocument();
- virtual bool saveDocumentAs( const QString& );
+ virtual bool saveDocumentAs( const QString&
, bool isBackup=false
);
virtual void closeDocument(bool permanently = true);
virtual void closeDocument(bool permanently = true);
+ virtual bool dump( const QString&, bool, bool, bool ) { return false; }
+
virtual bool isSaved() const;
virtual bool isModified() const;
virtual bool isSaved() const;
virtual bool isModified() const;
diff --git
a/src/SUIT/SUIT_Study.cxx
b/src/SUIT/SUIT_Study.cxx
index 054287882ddacfd0d199e3413428878e710f55ea..b1009a50170aa2a669d0ee499c02204dbc584c53 100644
(file)
--- a/
src/SUIT/SUIT_Study.cxx
+++ b/
src/SUIT/SUIT_Study.cxx
@@
-28,6
+28,15
@@
#include "SUIT_MessageBox.h"
#include "SUIT_Application.h"
#include "SUIT_MessageBox.h"
#include "SUIT_Application.h"
+//---------------------------------------------------------
+#define USE_DEBUG
+//#define MB_IGNORE_QT
+//#define MB_FULL_DUMP
+#define MBCLASSNAME "SUIT_Study"
+#include "MBDebug.h"
+// <-- insert includes for addtional debug headers here!
+//---------------------------------------------------------
+
/*!\class SUIT_Study
* Support study management. Object management. Operation management.
*/
/*!\class SUIT_Study
* Support study management. Object management. Operation management.
*/
@@
-41,9
+50,11
@@
myIsSaved( false ),
myIsModified( false ),
myBlockChangeState( false )
{
myIsModified( false ),
myBlockChangeState( false )
{
+ DBG_FUN();
static int _id = 0;
myId = ++_id;
static int _id = 0;
myId = ++_id;
+ SHOW(myId);
myRoot = new SUIT_DataObject();
}
myRoot = new SUIT_DataObject();
}
@@
-51,6
+62,7
@@
myBlockChangeState( false )
/*!Destructor.*/
SUIT_Study::~SUIT_Study()
{
/*!Destructor.*/
SUIT_Study::~SUIT_Study()
{
+ DBG_FUN();
delete myRoot;
myRoot = 0;
}
delete myRoot;
myRoot = 0;
}
@@
-142,11
+154,19
@@
bool SUIT_Study::openDocument( const QString& fileName )
/*!
* Save document as \a fileName. Set file name.
*/
/*!
* Save document as \a fileName. Set file name.
*/
-bool SUIT_Study::saveDocumentAs( const QString& fileName )
-{
- myName = fileName;
- myIsSaved = true;
- myIsModified = false;
+bool SUIT_Study::saveDocumentAs( const QString& fileName, bool isBackup/*=false*/ )
+{
+ DBG_FUN();
+ ARG(fileName);
+ ARG(isBackup);
+ if (!isBackup) {
+ myName = fileName;
+ myIsSaved = true;
+ myIsModified = false;
+ }
+ SHOW(myName);
+ SHOW(myIsSaved);
+ SHOW(myIsModified);
return true;
}
return true;
}
@@
-156,6
+176,7
@@
bool SUIT_Study::saveDocumentAs( const QString& fileName )
*/
bool SUIT_Study::saveDocument()
{
*/
bool SUIT_Study::saveDocument()
{
+ DBG_FUN();
return saveDocumentAs( myName );
}
return saveDocumentAs( myName );
}
diff --git
a/src/SUIT/SUIT_Study.h
b/src/SUIT/SUIT_Study.h
index 5ea1ad479c43c1e05b475f7d9839d09f51ecf411..b61821ab9eec0cf85e371de7fc4a96ebaed4df61 100644
(file)
--- a/
src/SUIT/SUIT_Study.h
+++ b/
src/SUIT/SUIT_Study.h
@@
-60,7
+60,7
@@
public:
virtual bool createDocument( const QString& );
bool saveDocument();
virtual bool createDocument( const QString& );
bool saveDocument();
- virtual bool saveDocumentAs( const QString& );
+ virtual bool saveDocumentAs( const QString&
, bool isBackup=false
);
virtual void update();
virtual void update();
diff --git
a/src/SalomeApp/SalomeApp_Study.cxx
b/src/SalomeApp/SalomeApp_Study.cxx
index 96aa82adca7e9e15e3693b4113cf6214bfa08c95..6d97460513d09610720625cf81714964b819b9fb 100644
(file)
--- a/
src/SalomeApp/SalomeApp_Study.cxx
+++ b/
src/SalomeApp/SalomeApp_Study.cxx
@@
-60,6
+60,15
@@
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
#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
//#define NOTIFY_BY_EVENT
class ObserverEvent : public QEvent
@@
-391,6
+400,7
@@
private:
SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
: LightApp_Study( app ), myObserver( 0 )
{
SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
: LightApp_Study( app ), myObserver( 0 )
{
+ DBG_FUN();
myStudyDS = SalomeApp_Application::getStudy();
}
myStudyDS = SalomeApp_Application::getStudy();
}
@@
-399,6
+409,7
@@
SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
*/
SalomeApp_Study::~SalomeApp_Study()
{
*/
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() );
if ( myObserver ) {
PortableServer::ObjectId_var oid = myObserver->_default_POA()->servant_to_id( myObserver );
myObserver->_default_POA()->deactivate_object( oid.in() );
@@
-447,6
+458,8
@@
_PTR(Study) SalomeApp_Study::studyDS() const
*/
bool SalomeApp_Study::createDocument( const QString& theStr )
{
*/
bool SalomeApp_Study::createDocument( const QString& theStr )
{
+ DBG_FUN();
+ ARG(theStr);
MESSAGE( "createDocument" );
setStudyName( QString::fromUtf8(myStudyDS->URL().c_str()) );
MESSAGE( "createDocument" );
setStudyName( QString::fromUtf8(myStudyDS->URL().c_str()) );
@@
-477,6
+490,8
@@
bool SalomeApp_Study::createDocument( const QString& theStr )
*/
bool SalomeApp_Study::openDocument( const QString& theFileName )
{
*/
bool SalomeApp_Study::openDocument( const QString& theFileName )
{
+ DBG_FUN();
+ ARG(theFileName);
MESSAGE( "openDocument" );
// read HDF file
MESSAGE( "openDocument" );
// read HDF file
@@
-547,6
+562,8
@@
bool SalomeApp_Study::openDocument( const QString& theFileName )
*/
bool SalomeApp_Study::loadDocument( const QString& theStudyName )
{
*/
bool SalomeApp_Study::loadDocument( const QString& theStudyName )
{
+ DBG_FUN();
+ ARG(theStudyName);
MESSAGE( "loadDocument" );
setRoot( new SalomeApp_RootObject( this ) ); // create myRoot
MESSAGE( "loadDocument" );
setRoot( new SalomeApp_RootObject( this ) ); // create myRoot
@@
-595,10
+612,14
@@
bool SalomeApp_Study::loadDocument( const QString& theStudyName )
Saves document
\param theFileName - name of file
*/
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 );
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 );
SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
ModelList list; dataModels( list );
@@
-611,7
+632,7
@@
bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
if ( LightApp_DataModel* aModel =
dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
listOfFiles.clear();
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);
if ( !listOfFiles.isEmpty() )
saveModuleData(aModel->module()->name(), 0, // 0 means persistence file
listOfFiles);
@@
-630,7
+651,7
@@
bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
res = res && saveStudyData(theFileName, 0); // 0 means persistence file
res = res && saveStudyData(theFileName, 0); // 0 means persistence file
- if ( res )
+ if ( res
&& !isBackup
)
emit saved( this );
return res;
emit saved( this );
return res;
@@
-641,6
+662,7
@@
bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
*/
bool SalomeApp_Study::saveDocument()
{
*/
bool SalomeApp_Study::saveDocument()
{
+ DBG_FUN();
bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true );
if ( store )
SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true );
if ( store )
SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
@@
-683,6
+705,7
@@
bool SalomeApp_Study::saveDocument()
*/
void SalomeApp_Study::closeDocument(bool permanently)
{
*/
void SalomeApp_Study::closeDocument(bool permanently)
{
+ DBG_FUN();
LightApp_Study::closeDocument(permanently);
// close SALOMEDS document
LightApp_Study::closeDocument(permanently);
// close SALOMEDS document
@@
-721,6
+744,11
@@
bool SalomeApp_Study::dump( const QString& theFileName,
bool isMultiFile,
bool toSaveGUI )
{
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);
int savePoint = 0;
_PTR(AttributeParameter) ap;
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
diff --git
a/src/SalomeApp/SalomeApp_Study.h
b/src/SalomeApp/SalomeApp_Study.h
index 38c6c0012a5540c96f268323ac25981841990c66..9f1bb755619acf073820455a5e6ac0151e71e05c 100644
(file)
--- a/
src/SalomeApp/SalomeApp_Study.h
+++ b/
src/SalomeApp/SalomeApp_Study.h
@@
-50,7
+50,7
@@
public:
virtual bool loadDocument( const QString& );
virtual bool saveDocument();
virtual bool loadDocument( const QString& );
virtual bool saveDocument();
- virtual bool saveDocumentAs( const QString& );
+ virtual bool saveDocumentAs( const QString&
, bool isBackup=false
);
virtual void closeDocument(bool permanently = true);
virtual void closeDocument(bool permanently = true);