QPtrListIterator<SUIT_Application> it( apps );
for( ; it.current(); ++it ) {
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( it.current() );
- if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId && anApp->objectBrowser() )
- anApp->objectBrowser()->updateTree();
+ if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId )
+ anApp->updateObjectBrowser();
}
}
}
}
}
-
void SalomeApp_Application::onRefresh()
{
- for ( ModuleListIterator it = modules(); it.current(); ++it )
- {
- CAM_DataModel* camDM = it.current()->dataModel();
- if ( camDM && camDM->inherits( "SalomeApp_DataModel" ) )
- ((SalomeApp_DataModel*)camDM)->update();
- }
- objectBrowser()->updateTree();
+ updateObjectBrowser( true );
}
void SalomeApp_Application::setActiveStudy( SUIT_Study* study )
thePopup->insertItem( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
}
+void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
+{
+ if ( updateModels )
+ {
+ for ( ModuleListIterator it = modules(); it.current(); ++it )
+ {
+ CAM_DataModel* camDM = it.current()->dataModel();
+ if ( camDM && camDM->inherits( "SalomeApp_DataModel" ) )
+ ((SalomeApp_DataModel*)camDM)->update();
+ }
+ }
+ if ( objectBrowser() )
+ objectBrowser()->updateTree();
+}
OB_Browser* objectBrowser();
PythonConsole* pythonConsole();
+ virtual void updateObjectBrowser( const bool = true );
+
SalomeApp_Preferences* preferences() const;
virtual QString getFileFilter() const;