HYDROGUI_DataModel::HYDROGUI_DataModel( CAM_Module* theModule )
-: LightApp_DataModel( theModule ), myIsAboutToClose(false)
+: LightApp_DataModel( theModule )
{
DEBTRACE("HYDROGUI_DataModel");
update( module()->application()->activeStudy()->id() );
bool HYDROGUI_DataModel::close()
{
DEBTRACE("close");
- myIsAboutToClose = true;
HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
if ( aModule )
aModule->clearCache();
return true;
}
-bool HYDROGUI_DataModel::isAboutToClose()
-{
- DEBTRACE("isAboutToClose " << myIsAboutToClose);
- return myIsAboutToClose;
-}
-
bool HYDROGUI_DataModel::dumpPython( const QString& theURL,
CAM_Study* theStudy,
bool isMultiFile,
* Close the model and remove data. Reimplemented.
*/
virtual bool close();
- virtual bool isAboutToClose();
/**
* Dump study data to Python script. Reimplemented.
protected:
QString myStudyURL; ///< the saved/opened document URL
QByteArray myStates;
- bool myIsAboutToClose;
};
#endif
#include <QStatusBar>
#include <QCursor>
-//#define _DEVDEBUG_
+#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
static int ViewManagerId = 0;
myViewManagerMap.clear();
bool ret = LightApp_Module::deactivateModule( theStudy );
- HYDROGUI_DataModel* aModel = getDataModel();
- if (aModel->isAboutToClose())
- {
+ return ret;
+}
+
+void HYDROGUI_Module::studyClosed(SUIT_Study* theStudy)
+{
+ DEBTRACE("HYDROGUI_Module::studyClosed");
Handle(HYDROData_Document) aDoc = HYDROData_Document::Document();
if (!aDoc.IsNull())
aDoc->Close();
- }
- return ret;
}
void HYDROGUI_Module::windows( QMap<int, int>& theMap ) const
virtual void updateCommandsStatus();
virtual void selectionChanged();
+ virtual void studyClosed( SUIT_Study* );
SUIT_ViewManager* getViewManager( const int theId ) const;
HYDROGUI_DataModel* getDataModel() const;