-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#ifndef DISABLE_SALOMEOBJECT
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#endif
#ifndef DISABLE_VTKVIEWER
#include <GLViewer_ViewFrame.h>
#include <GLViewer_ViewPort.h>
#endif
+#ifndef DISABLE_PVVIEWER
+ #include <PVViewer_ViewManager.h>
+ #include <PVViewer_ViewWindow.h>
+#endif
#ifndef DISABLE_PLOT2DVIEWER
#include <Plot2d_ViewWindow.h>
#include <Plot2d_ViewFrame.h>
popupMgr()->setSelection( sel );
popupMgr()->setMenu( menu );
popupMgr()->updateMenu();
+ popupMgr()->setSelection( 0 );
}
/*!Update object browser.
void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
SUIT_DataObject* theDataObject )
{
+ if (!getApp()->objectBrowser())
+ return;
bool upd = getApp()->objectBrowser()->autoUpdate();
getApp()->objectBrowser()->setAutoUpdate( false );
// check data type of selection
SALOME_ListIteratorOfListIO It( selected );
for ( ; isCompatible && It.More(); It.Next()) {
- Handle(SALOME_InteractiveObject)& io = It.Value();
+ Handle(SALOME_InteractiveObject) io = It.Value();
isCompatible = ( aStudy->componentDataType( io->getEntry() ) == moduleDataType );
}
}
treeModel->setAppropriate( EntryCol, Qtx::Toggled );
}*/
- if ( myIsFirstActivate ) {
- updateModuleVisibilityState();
- myIsFirstActivate = false;
- }
-
return res;
}
{
}
+/*!NOT IMPLEMENTED*/
+void LightApp_Module::updateInfoPanel()
+{
+}
+
/*!NOT IMPLEMENTED*/
void LightApp_Module::createPreferences()
{
#ifndef DISABLE_GLVIEWER
if ( viewWnd->inherits( "GLViewer_ViewFrame" ) )
( (GLViewer_ViewFrame*)viewWnd )->getViewPort()->onUpdate();
+#endif
+#ifndef DISABLE_PVVIEWER
+// if ( viewWnd->inherits( "PVViewer_ViewWindow" ) )
+// ( (PVViewer_ViewWindow*)viewWnd )->getViewPort()->onUpdate();
#endif
}
}
myPopupMgr->insert( eraseAll, -1, 0 );
myPopupMgr->insert( separator(), -1, 0 );
- QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) )";
+ QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) ) and ( not($displayer={'%3'}) )";
QString uniform = "true in $canBeDisplayed and %1 and ( activeModule = '%2' )";
- uniform = uniform.arg( oneAndNotActive ).arg( name() );
+ uniform = uniform.arg( oneAndNotActive ).arg( name() ).arg( LightApp_Application::moduleDisplayer( name() ) );
myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
myPopupMgr->setRule( dispOnly, uniform, QtxPopupMgr::VisibleRule );
/*!
virtual method called to manage the same operations
*/
-bool LightApp_Module::reusableOperation( const int id )
+bool LightApp_Module::reusableOperation( const int /*id*/ )
{
return true;
}
SUIT_DataBrowser* ob = app->objectBrowser();
if ( !ob || !ob->model() ) return;
+ if ( !myIsFirstActivate )
+ return;
+
+ myIsFirstActivate = false;
+
// connect to click on item
connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
+ // connect to click on item
+ connect( ob, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( onOBDestroyed() ), Qt::UniqueConnection );
SUIT_DataObject* rootObj = ob->root();
if ( !rootObj ) return;
if ( id != -1 )
startOperation( id );
}
+
+void LightApp_Module::onOBDestroyed()
+{
+ myIsFirstActivate = true;
+}