{
if ( !myModule->deactivateModule( activeStudy() ) )
{
- // ....
- }
+ // ???
+ }
+ moduleDeactivated( myModule );
}
myModule = mod;
- if ( myModule ){
+ if ( myModule )
+ {
// Connect the module to the active study
myModule->connectToStudy( dynamic_cast<CAM_Study*>( activeStudy() ) );
if ( !myModule->activateModule( activeStudy() ) )
{
}
+/*!
+ \brief Callback function, called when the module is just deactivated.
+
+ This virtual method can be re-implemented in the successors. Base implementation
+ does nothing.
+
+ \param mod module just deactivated
+*/
+void CAM_Application::moduleDeactivated( CAM_Module* /*mod*/ )
+{
+}
+
/*!
\brief Get module name by its title (user name).
\param title module title (user name)
virtual bool checkModule( const QString& );
virtual void moduleAdded( CAM_Module* );
+ virtual void moduleDeactivated( CAM_Module* );
virtual void beforeCloseDoc( SUIT_Study* );
virtual void afterCloseDoc();
virtual bool activateModule( CAM_Module* = 0 );
}
}
+void LightApp_Application::moduleDeactivated( CAM_Module* /*mod*/ )
+{
+ if ( infoPanel() )
+ infoPanel()->clear();
+}
+
void LightApp_Application::emptyPreferences( const QString& modName )
{
QtxPreferenceItem* item = myPrefs->findItem( modName, true );
virtual void beforeCloseDoc( SUIT_Study* );
virtual void afterCloseDoc();
virtual void moduleAdded( CAM_Module* );
+ virtual void moduleDeactivated( CAM_Module* );
virtual bool activateModule( CAM_Module* = 0 );
LightApp_Preferences* preferences( const bool ) const;
void QtxInfoPanel::Container::addAction( QAction* action, const int id )
{
+ static const char* empty_xpm[] = {"16 16 1 1",
+ " c None",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "};
QToolButton* button = new QToolButton( this );
button->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
button->setAutoRaise( true );
+ if ( action->icon().isNull() )
+ action->setIcon( QPixmap(empty_xpm) );
button->setDefaultAction( action );
put( button );
ids[ id ] = button;