return ProcessEvent( new TGetObjectBrowserEvent() );
}
-/*!
- \fn int SalomePyQt::getStudyId();
- \brief Get active study's identifier.
- \return active study ID or 0 if there is no active study
-*/
-
-class TGetStudyIdEvent: public SALOME_Event
-{
-public:
- typedef int TResult;
- TResult myResult;
- TGetStudyIdEvent() : myResult( 0 ) {}
- virtual void Execute()
- {
- if ( LightApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->id();
- }
- }
-};
-int SalomePyQt::getStudyId()
-{
- return ProcessEvent( new TGetStudyIdEvent() );
-}
-
/*!
\fn SALOME_Selection* SalomePyQt::getSelection();
\brief Get the selection object for the current study.
}
/*!
- \brief Update an Object Browser of the specified (by identifier) study.
-
- If \a studyId <= 0 the active study's object browser is updated.
- The \a updateSelection parameter is obsolete and currently is not used.
- This parameter will be removed in future, so try to avoid its usage in
- your code.
-
- \brief studyId study identifier
- \brief updateSelection update selection flag (not used)
- \sa getActiveStudy()
+ \brief Update an Object Browser of the study.
*/
-void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection )
+void SalomePyQt::updateObjBrowser()
{
class TEvent: public SALOME_Event
{
- int myStudyId;
- bool myUpdateSelection;
public:
- TEvent( const int studyId, bool updateSelection )
- : myStudyId( studyId ), myUpdateSelection( updateSelection ) {}
+ TEvent() {}
virtual void Execute()
{
if ( SUIT_Session::session() ) {
- if ( getActiveStudy() && myStudyId <= 0 )
- myStudyId = getActiveStudy()->id();
- if ( myStudyId > 0 ) {
+ if ( getActiveStudy() ) {
QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
QList<SUIT_Application*>::Iterator it;
for( it = apps.begin(); it != apps.end(); ++it ) {
LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( *it );
- if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) {
+ if ( anApp && anApp->activeStudy() ) {
anApp->updateObjectBrowser();
return;
}
}
}
};
- ProcessVoidEvent( new TEvent( studyId, updateSelection ) );
+ ProcessVoidEvent( new TEvent() );
}