X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSALOME_PYQT%2FSalomePyQt%2FSalomePyQt.cxx;h=6b2eb96a08170e97da444888e37d96bcf814f7b9;hb=331294345d3e1716fbf79ae25a2851011729be79;hp=04074001c49a9dfe05d0d07a5d7c38b8f74576c1;hpb=55d7818a64220bc91b64a8f9021e48f7df12ced7;p=modules%2Fgui.git diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 04074001c..6b2eb96a0 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -177,7 +177,7 @@ namespace if ( app && !fileName.isEmpty() ) { QPixmap pixmap = app->resourceMgr()->loadPixmap( module, QApplication::translate( module.toLatin1().data(), - fileName.toLatin1().data() ) ); + fileName.toUtf8().data() ) ); if ( !pixmap.isNull() ) icon = QIcon( pixmap ); } @@ -598,30 +598,6 @@ QTreeView* SalomePyQt::getObjectBrowser() 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. @@ -824,37 +800,23 @@ bool SalomePyQt::activateModule( const QString& modName ) } /*! - \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 apps = SUIT_Session::session()->applications(); QList::Iterator it; for( it = apps.begin(); it != apps.end(); ++it ) { LightApp_Application* anApp = dynamic_cast( *it ); - if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) { + if ( anApp && anApp->activeStudy() ) { anApp->updateObjectBrowser(); return; } @@ -863,7 +825,7 @@ void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection ) } } }; - ProcessVoidEvent( new TEvent( studyId, updateSelection ) ); + ProcessVoidEvent( new TEvent() ); }