#include "SalomeApp_Study.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_OBFilter.h"
+#include "SalomeApp_DataModel.h"
+#include "SalomeApp_DataObject.h"
#include "SalomeApp_EventFilter.h"
#include "SalomeApp_WidgetContainer.h"
#include <Utils_ORB_INIT.hxx>
#include <Utils_SINGLETON.hxx>
#include <SALOME_ModuleCatalog_impl.hxx>
+#include <SALOME_LifeCycleCORBA.hxx>
#include <qmap.h>
#include <qdir.h>
{
}
+void SalomeApp_Application::onAboutRefresh()
+{
+ SalomeApp_DataModel* dm = 0;
+ if ( activeModule() )
+ {
+ CAM_DataModel* camDM = activeModule()->dataModel();
+ if ( camDM && camDM->inherits( "SalomeApp_DataModel" ) )
+ dm = (SalomeApp_DataModel*)camDM;
+ }
+
+ if ( dm )
+ dm->update();
+}
+
void SalomeApp_Application::setActiveStudy( SUIT_Study* study )
{
CAM_Application::setActiveStudy( study );
ob->resize( OBJECT_BROWSER_WIDTH, ob->height() );
ob->setFilter( new SalomeApp_OBFilter( selectionMgr() ) );
+ ob->setNameTitle( tr( "OBJ_BROWSER_NAME" ) );
+ for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
+ ob->addColumn( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), i );
+
// Create OBSelector
new SalomeApp_OBSelector( ob, mySelMgr );
wid = ob;
+ connect( ob, SIGNAL( aboutRefresh() ), this, SLOT( onAboutRefresh() ) );
ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
else if ( flag == WT_PyConsole )
logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
-
+
return wid;
}
CORBA::ORB_var SalomeApp_Application::orb()
{
ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- CORBA::ORB_var& orb = init( qApp->argc(), qApp->argv() );
-
- return orb;
+ static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ return _orb;
}
SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr()
{
- static SALOMEDSClient_StudyManager* aStudyManager = NULL;
-
- if(!aStudyManager) {
- aStudyManager = new SALOMEDS_StudyManager();
- }
- return aStudyManager;
+ static SALOMEDSClient_StudyManager* _sm = new SALOMEDS_StudyManager();
+ return _sm;
}
SALOME_NamingService* SalomeApp_Application::namingService()
{
- return new SALOME_NamingService( orb() );
+ static SALOME_NamingService* _ns = new SALOME_NamingService( orb() );
+ return _ns;
+}
+
+SALOME_LifeCycleCORBA* SalomeApp_Application::lcc()
+{
+ static SALOME_LifeCycleCORBA* _lcc = new SALOME_LifeCycleCORBA( namingService() );
+ return _lcc;
}
QString SalomeApp_Application::defaultEngineIOR()