This module provides an access to the SALOME GUI implementing set of functions
which can be used from Python. This module is implemented using SWIG wrappings
for some GUI functionality:
- - getActiveStudyId(), getActiveStudyName() : get active study identifier and name
+ - getActiveStudyName() : get active study name
- updateObjBrowser() : update contents of the Object Browser
- SelectedCount() : get number of currently selected items
- getSelected() : get entry of the speicified selected item
/*!
\brief Update active study's Object Browser.
- \param updateSelection this parameter is obsolete
*/
-void SALOMEGUI_Swig::updateObjBrowser( bool /*updateSelection*/ )
+void SALOMEGUI_Swig::updateObjBrowser()
{
class TEvent: public SALOME_Event
{
ProcessVoidEvent( new TEvent() );
}
-/*!
- \fn int SALOMEGUI_Swig::getActiveStudyId()
- \brief Get active study identifier
- \return active study's ID or 0 if there is no active study
-*/
-
-class TGetActiveStudyIdEvent: public SALOME_Event
-{
-public:
- typedef int TResult;
- TResult myResult;
- TGetActiveStudyIdEvent() : myResult( 0 ) {}
- virtual void Execute()
- {
- if ( LightApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->id();
- }
- }
-};
-int SALOMEGUI_Swig::getActiveStudyId()
-{
- return ProcessEvent( new TGetActiveStudyIdEvent() );
-}
-
/*!
\fn const char* SALOMEGUI_Swig::getActiveStudyName()
\brief Get active study name
{
QStringList selected = ProcessEvent( new TGetSelectedEvent() );
return index >= 0 && index < selected.count() ?
- strdup( selected[ index ].toLatin1().constData() ) : 0;
+ strdup( selected[ index ].toUtf8().constData() ) : 0;
}
/*!
LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
if ( aStudy && aSelMgr ) {
SALOME_ListIO anIOList;
- anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
+ anIOList.Append( new SALOME_InteractiveObject( myEntry.toUtf8(), "", "" ) );
aSelMgr->setSelectedObjects( anIOList, true );
}
}
aSelMgr->selectedObjects( anIOList );
SALOME_ListIteratorOfListIO anIter( anIOList );
for( ; anIter.More(); anIter.Next() ) {
- if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) {
+ if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toUtf8(), "", "" ) ) ) {
anIOList.Remove( anIter );
aSelMgr->setSelectedObjects( anIOList, true );
return;
if ( window ) {
SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
if ( view ) {
- SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
+ SALOME_Prs* aPrs = view->CreatePrs( myEntry.toUtf8() );
myResult = !aPrs->IsNull();
}
}
const char* SALOMEGUI_Swig::getViewParameters() {
QString result = ProcessEvent( new TGetViewParameters() );
- return result.isEmpty() ? 0 : strdup( result.toLatin1().constData() );
+ return result.isEmpty() ? 0 : strdup( result.toUtf8().constData() );
}