#include "LightApp_OBSelector.h"
#include "LightApp_SelectionMgr.h"
+#include "LightApp_DataObject.h"
#include <CAM_Module.h>
#include <CAM_DataModel.h>
}
return CAM_Application::event( e );
}
+
+/*! Check data object */
+bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj)
+{
+ if (theObj)
+ {
+ bool isSuitable = !theObj->entry().isEmpty() &&
+ !theObj->componentDataType().isEmpty() &&
+ !theObj->name().isEmpty();
+ return isSuitable;
+ }
+
+ return false;
+}
class LightApp_WidgetContainer;
class LightApp_Preferences;
class LightApp_SelectionMgr;
+class LightApp_DataObject;
class SUIT_Study;
class SUIT_Accel;
class CAM_Module;
static int studyId();
virtual bool event( QEvent* );
+
+ virtual bool checkDataObject( LightApp_DataObject* theObj );
signals:
void studyOpened();
virtual void preferencesChanged( const QString&, const QString& );
virtual void savePreferences();
virtual void updateDesktopTitle();
-
+
protected slots:
virtual void onDesktopActivated();
#include "LightApp_DataOwner.h"
#include "LightApp_DataObject.h"
+#include "LightApp_Application.h"
#include <OB_Browser.h>
+#include <SUIT_Session.h>
#include <SUIT_DataObjectIterator.h>
#include <qdatetime.h>
void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
{
if (mySelectedList.count() == 0 ) {
+ SUIT_Session* session = SUIT_Session::session();
+ SUIT_Application* sapp = session ? session->activeApplication() : 0;
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>( sapp );
+ if( !app )
+ return;
+
if ( !myBrowser )
return;
DataObjectList objlist;
for ( DataObjectListIterator it( objlist ); it.current(); ++it )
{
LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
- if ( obj && !obj->entry().isEmpty() && !obj->componentDataType().isEmpty() && !obj->name().isEmpty() )
+ if ( obj && app->checkDataObject(obj) )
{
#ifndef DISABLE_SALOMEOBJECT
Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
delete it.data();
}
+/*! Check data object */
+bool SalomeApp_Application::checkDataObject(LightApp_DataObject* theObj)
+{
+ if (theObj)
+ return true;
+
+ return false;
+}
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
+ virtual bool checkDataObject(LightApp_DataObject* theObj);
+
static CORBA::ORB_var orb();
static SALOMEDSClient_StudyManager* studyMgr();
static SALOME_NamingService* namingService();
virtual void createPreferences( LightApp_Preferences* );
virtual void updateDesktopTitle();
-
+
private slots:
void onDeleteInvalidReferences();
void onDblClick( QListViewItem* );