+/*!
+ \brief Close of the module.
+
+ This function is usually used in order to close the module's
+ specific menus and toolbars and perform other such actions
+ required when the module is closed.
+*/
+void PyModuleHelper::modelClosed( SUIT_Study* study )
+{
+ FuncMsg fmsg( "PyModuleHelper::modelClosed()" );
+
+ class StudyClosedReq : public PyInterp_LockRequest
+ {
+ public:
+ StudyClosedReq( PyInterp_Interp* _py_interp,
+ PyModuleHelper* _helper,
+ SUIT_Study* _study )
+ : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
+ myHelper( _helper ),
+ myStudy ( _study )
+ {}
+ protected:
+ virtual void execute()
+ {
+ myHelper->internalClosedStudy( myStudy );
+ }
+ private:
+ PyModuleHelper* myHelper;
+ SUIT_Study* myStudy;
+ };
+
+ // post request
+ PyInterp_Dispatcher::Get()->Exec( new StudyClosedReq( myInterp, this, study ) );
+
+ // disconnect preferences changing signal
+ disconnect( myModule->getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
+ this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) );
+
+ // disconnect the SUIT_Desktop signal windowActivated()
+ SUIT_Desktop* d = study->application()->desktop();
+ disconnect( d, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+ this, SLOT( activeViewChanged( SUIT_ViewWindow* ) ) );
+
+ // deactivate menus, toolbars, etc
+ if ( myXmlHandler ) myXmlHandler->activateMenus( false );
+
+ // hide menus / toolbars
+ myModule->setMenuShown( false );
+ myModule->setToolShown( false );
+}
+
+