Salome HOME
Copyright update 2022
[modules/gui.git] / src / LightApp / LightApp_Module.cxx
index 02845df16da49ac17f4e030003f4366cb112ecf1..e5fef3efa9c1d5ac6bffc24d9b73433b0afa263a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  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
@@ -149,6 +149,7 @@ void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QStr
   popupMgr()->setSelection( sel );
   popupMgr()->setMenu( menu );
   popupMgr()->updateMenu();
+  popupMgr()->setSelection( 0 );
 }
 
 /*!Update object browser.
@@ -157,6 +158,8 @@ void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QStr
 void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel, 
                                         SUIT_DataObject* theDataObject )
 {
+  if (!getApp()->objectBrowser())
+    return;
   bool upd = getApp()->objectBrowser()->autoUpdate();
   getApp()->objectBrowser()->setAutoUpdate( false );
 
@@ -312,6 +315,11 @@ void LightApp_Module::MenuItem()
 {
 }
 
+/*!NOT IMPLEMENTED*/
+void LightApp_Module::updateInfoPanel()
+{
+}
+
 /*!NOT IMPLEMENTED*/
 void LightApp_Module::createPreferences()
 {
@@ -455,9 +463,9 @@ QtxPopupMgr* LightApp_Module::popupMgr()
     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 );
@@ -697,7 +705,7 @@ LightApp_Operation* LightApp_Module::operation( const int id ) const
 /*!
   virtual method called to manage the same operations
 */
-bool LightApp_Module::reusableOperation( const int id )
+bool LightApp_Module::reusableOperation( const int /*id*/ )
 {
  return true;
 }