]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Process properly visibility state (eye icon) for 'light' modules
authorvsr <vsr@opencascade.com>
Mon, 14 Apr 2014 06:58:30 +0000 (10:58 +0400)
committervsr <vsr@opencascade.com>
Mon, 14 Apr 2014 06:58:30 +0000 (10:58 +0400)
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_Module.cxx
src/LightApp/LightApp_Module.h
src/SUIT/SUIT_TreeModel.cxx
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_Module.cxx
src/SalomeApp/SalomeApp_Module.h

index 6038e048e8cc62b71bff40da143a7bd43e3f7473..15c0e9aa40ff091de1deeb25a297c0ca824daac7 100644 (file)
@@ -43,6 +43,7 @@
 #include "LightApp_Module.h"
 #include "LightApp_DataModel.h"
 #include "LightApp_DataOwner.h"
+#include "LightApp_Displayer.h"
 #include "LightApp_Study.h"
 #include "LightApp_Preferences.h"
 #include "LightApp_PreferencesDlg.h"
@@ -378,6 +379,11 @@ LightApp_Application::LightApp_Application()
 #endif
 
   connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
+  connect( desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+           this,      SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+  connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+           this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
+
 
   // Set existing font for the python console in resources
   if( !aResMgr->hasValue( "PyConsole", "font" ) )
@@ -1688,6 +1694,11 @@ void LightApp_Application::onStudySaved( SUIT_Study* s )
 /*!Protected SLOT. On study closed.*/
 void LightApp_Application::onStudyClosed( SUIT_Study* s )
 {
+  /*
+  disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+             this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
+  */
+
   // stop auto-save timer
   myAutoSaveTimer->stop();
 
@@ -3586,6 +3597,8 @@ void LightApp_Application::setDesktop( SUIT_Desktop* desk )
   if ( desk ) {
     connect( desk, SIGNAL( message( const QString& ) ),
              this, SLOT( onDesktopMessage( const QString& ) ), Qt::UniqueConnection );
+    connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+             this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
   }
 }
 
@@ -4335,3 +4348,73 @@ void LightApp_Application::emitOperationFinished( const QString& theModuleName,
 {
   emit operationFinished( theModuleName, theOperationName, theEntryList );
 }
+
+/*!
+  Update visibility state of given objects
+*/
+void LightApp_Application::updateVisibilityState( DataObjectList& theList,
+                                                 SUIT_ViewModel*  theViewModel )
+{
+  if ( !theViewModel || theList.isEmpty() ) return;
+
+  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+  if ( !aStudy ) return;
+
+  SALOME_View* aView = dynamic_cast<SALOME_View*>( theViewModel );
+
+  for ( DataObjectList::iterator itr = theList.begin(); itr != theList.end(); ++itr ) {
+    LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>(*itr);
+
+    if ( !obj || aStudy->isComponent( obj->entry() ) )
+      continue;
+
+    LightApp_Module* anObjModule = dynamic_cast<LightApp_Module*>(obj->module());
+    if ( anObjModule ) {
+      LightApp_Displayer* aDisplayer = anObjModule->displayer();
+      if ( aDisplayer ) {
+       Qtx::VisibilityState anObjState = Qtx::UnpresentableState;
+        if ( aDisplayer->canBeDisplayed( obj->entry(), theViewModel->getType() ) ) {
+          if ( aView && aDisplayer->IsDisplayed( obj->entry(), aView ) )
+            anObjState = Qtx::ShownState;
+          else
+            anObjState = Qtx::HiddenState;
+        }
+       aStudy->setVisibilityState( obj->entry(), anObjState );
+      }
+    }
+  }
+}
+
+/*!
+ * Called when window activated
+ */
+void LightApp_Application::onWindowActivated( SUIT_ViewWindow* theViewWindow )
+{
+  SUIT_DataBrowser* anOB = objectBrowser();
+  if ( !anOB )
+    return;
+  SUIT_DataObject* rootObj = anOB->root();
+  if ( !rootObj )
+    return;
+
+  DataObjectList listObj = rootObj->children( true );
+
+  SUIT_ViewModel* vmod = 0;
+  if ( SUIT_ViewManager* vman = theViewWindow->getViewManager() )
+    vmod = vman->getViewModel();
+  updateVisibilityState( listObj, vmod );
+}
+
+/*!
+  Called then view manager removed
+*/
+void LightApp_Application::onViewManagerRemoved( SUIT_ViewManager* )
+{
+  ViewManagerList lst;
+  viewManagers( lst );
+  if ( lst.count() == 1) { // in case if closed last view window
+    LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( activeStudy() );
+    if ( aStudy )
+      aStudy->setVisibilityStateForAll( Qtx::UnpresentableState );
+  }
+}
index f017b06e3b6e805923a7b8bff00da655feaafa9c..1fcef083d6aeeba8b3e0c667d3cd8e436b32d075 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "LightApp.h"
 #include <SUIT_TreeModel.h>
+#include <SUIT_DataObject.h>
 #include <CAM_Application.h>
 
 #include <QPointer>
@@ -50,6 +51,7 @@ class LightApp_DataObject;
 class SUIT_DataBrowser;
 class SUIT_Study;
 class SUIT_Accel;
+class SUIT_ViewModel;
 class CAM_Module;
 
 class QString;
@@ -174,6 +176,9 @@ public:
 
   void                                emitOperationFinished( const QString&, const QString&, const QStringList& );
 
+  void                                updateVisibilityState( DataObjectList& theList,
+                                                             SUIT_ViewModel* theViewModel );  
+
 signals:
   void                                studyOpened();
   void                                studySaved();
@@ -223,15 +228,17 @@ protected:
 
 protected slots:
   virtual void                        onDesktopActivated();
+  virtual void                        onViewManagerRemoved( SUIT_ViewManager* );
+  virtual void                        onWindowActivated( SUIT_ViewWindow* theViewWindow );
 
   void                                onNewWindow();
   void                                onModuleActivation( const QString& );
   void                                onCloseView( SUIT_ViewManager* );
 
-  void                                onStudyCreated( SUIT_Study* );
-  void                                onStudyOpened( SUIT_Study* );
-  void                                onStudySaved( SUIT_Study* );
-  void                                onStudyClosed( SUIT_Study* );
+  virtual void                        onStudyCreated( SUIT_Study* );
+  virtual void                        onStudyOpened( SUIT_Study* );
+  virtual void                        onStudySaved( SUIT_Study* );
+  virtual void                        onStudyClosed( SUIT_Study* );
 
   void                                onWCDestroyed( QObject* );
 
index 41e803fabbc0aa2c230f761f19268a20ceb12ff6..2127f020835172cb37488d7693dd7b74107294d8 100644 (file)
@@ -49,6 +49,7 @@
 #include <SUIT_ShortcutMgr.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_TreeModel.h>
+#include <SUIT_Session.h>
 
 #ifndef DISABLE_SALOMEOBJECT
 #include <SALOME_ListIO.hxx>
@@ -104,7 +105,8 @@ LightApp_Module::LightApp_Module( const QString& name )
   myDisplay( -1 ),
   myErase( -1 ),
   myDisplayOnly( -1 ),
-  myEraseAll( -1 )
+  myEraseAll( -1 ),
+  myIsFirstActivate( true )
 {
 }
 
@@ -243,6 +245,12 @@ bool LightApp_Module::activateModule( SUIT_Study* study )
     m->registerColumn( getApp()->objectBrowser(), EntryCol, LightApp_DataObject::EntryId );
     treeModel->setAppropriate( EntryCol, Qtx::Toggled );
   }*/
+
+  if ( myIsFirstActivate ) {
+    updateModuleVisibilityState();
+    myIsFirstActivate = false;
+  }
+  
   return res;
 }
 
@@ -285,6 +293,22 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study )
   return CAM_Module::deactivateModule( study );
 }
 
+/*! Redefined to reset internal flags valid for study instance */
+void LightApp_Module::studyClosed( SUIT_Study* theStudy )
+{
+  CAM_Module::studyClosed( theStudy );
+  
+  myIsFirstActivate = true;
+  
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>(application());
+  if ( app ) {
+    SUIT_DataBrowser* ob = app->objectBrowser();
+    if ( ob && ob->model() )
+      disconnect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+                 this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ) );
+  }
+}
+
 /*!NOT IMPLEMENTED*/
 void LightApp_Module::MenuItem()
 {
@@ -756,3 +780,61 @@ bool LightApp_Module::renameObject( const QString& /*entry*/, const QString& /*n
 {
   return false;
 }
+
+/*!
+  Update visibility state for data objects
+*/
+void LightApp_Module::updateModuleVisibilityState()
+{
+  // update visibility state of objects
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>(SUIT_Session::session()->activeApplication());
+  if ( !app ) return;
+  
+  SUIT_DataBrowser* ob = app->objectBrowser();
+  if ( !ob || !ob->model() ) return;
+
+  // connect to click on item
+  connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+           this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
+
+  SUIT_DataObject* rootObj = ob->root();
+  if ( !rootObj ) return;
+  
+  DataObjectList listObj = rootObj->children( true );
+  
+  SUIT_ViewModel* vmod = 0;
+  if ( SUIT_ViewManager* vman = app->activeViewManager() )
+    vmod = vman->getViewModel();
+  app->updateVisibilityState( listObj, vmod );
+}
+
+/*!
+ * \brief Virtual public slot
+ *
+ * This method is called after the object inserted into data view to update their visibility state
+ * This is default implementation
+ */
+void LightApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn )
+{
+  if ( !isActiveModule() ) return;
+
+  // change visibility of object
+  if ( !theObject || theColumn != SUIT_DataObject::VisibilityId ) return;
+
+  LightApp_Study* study = dynamic_cast<LightApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  if ( !study ) return;
+
+  LightApp_DataObject* lo = dynamic_cast<LightApp_DataObject*>( theObject );
+  if ( !lo ) return;
+  
+  // detect action index (from LightApp level)
+  int id = -1;
+  
+  if ( study->visibilityState( lo->entry() ) == Qtx::ShownState )
+    id = myErase;
+  else if ( study->visibilityState( lo->entry() ) == Qtx::HiddenState )
+    id = myDisplay;
+  
+  if ( id != -1 )
+    startOperation( id );
+}
index 49729b95e1458142cdd7473e727abc9b0d8a28f1..6572aef1d6a6de316b0cf292d8cb06af9d267bbd 100644 (file)
@@ -106,9 +106,13 @@ public:
   virtual bool                        renameAllowed( const QString& ) const;
   virtual bool                        renameObject( const QString&, const QString& );
 
+  virtual void                        updateModuleVisibilityState();
+
 public slots:
   virtual bool                        activateModule( SUIT_Study* );
   virtual bool                        deactivateModule( SUIT_Study* );
+  virtual void                        studyClosed( SUIT_Study* );
+  virtual void                        onObjectClicked( SUIT_DataObject*, int );
 
   void                                MenuItem();
 
@@ -165,6 +169,7 @@ private:
 
 protected:
   int                   myDisplay, myErase, myDisplayOnly, myEraseAll;
+  bool                  myIsFirstActivate;
 };
 
 #ifdef WIN32
index 5fcd23c1778212994dd309e58f6fb28e401ca576..6ac1d67b386772679dd62b63f96faadd17a42456 100755 (executable)
@@ -711,34 +711,8 @@ void SUIT_TreeModel::setVisibilityState( const QString& id, Qtx::VisibilityState
 */
 void SUIT_TreeModel::setVisibilityStateForAll( Qtx::VisibilityState state )
 {
-  if ( state != Qtx::UnpresentableState ) {
-    VisibilityMap::ConstIterator it = myVisibilityMap.begin();
-    while ( it != myVisibilityMap.end() ) {
-      if ( it.value() != state )
-       setVisibilityState( it.key(), state );
-      it++;
-    }
-  }
-  else {
-    QList<QString> anIds = myVisibilityMap.keys();
-    myVisibilityMap.clear();
-    QList<QString>::ConstIterator it = anIds.begin();
-    while ( it != anIds.end() ) {
-      QModelIndexList lst;
-      if ( searcher() ) {
-       SUIT_DataObject* o = searcher()->findObject( *it );
-       if ( o ) lst << index( o );
-      }
-      else {
-       lst = match( index( 0, root()->customData( Qtx::IdType ).toInt() ), DisplayRole, (*it), 1, Qt::MatchExactly | Qt::MatchRecursive );
-      }
-      if ( !lst.isEmpty() ) {
-       QModelIndex idx = index( lst.first().row(), SUIT_DataObject::VisibilityId ,lst.first().parent() );
-       emit dataChanged( idx, idx );
-      }
-      it++;
-    }
-  }
+  foreach( QString id, myVisibilityMap.keys() )
+    setVisibilityState( id, state );
 }
 
 /*!
index 2dfa32ca9f0dbc3fea452e524a8a2be617f1396a..0ae89d09dc4f34fd13d61ef5727f3501d111bac4 100644 (file)
@@ -54,7 +54,6 @@
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_NameDlg.h>
 #include <LightApp_DataOwner.h>
-#include <LightApp_Displayer.h>
 
 #include <CAM_Module.h>
 
@@ -165,8 +164,6 @@ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
 SalomeApp_Application::SalomeApp_Application()
   : LightApp_Application()
 {
-  connect( desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
-           this,      SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
   connect( desktop(), SIGNAL( message( const QString& ) ),
            this, SLOT( onLoadDocMessage( const QString& ) ), Qt::UniqueConnection );
   myIsSiman = false; // default
@@ -396,8 +393,6 @@ void SalomeApp_Application::setDesktop( SUIT_Desktop* desk )
   LightApp_Application::setDesktop( desk );
 
   if ( desk ) {
-    connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
-             this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
     connect( desk, SIGNAL( message( const QString& ) ),
              this, SLOT( onLoadDocMessage( const QString& ) ), Qt::UniqueConnection );
   }
@@ -1576,25 +1571,9 @@ void SalomeApp_Application::onStudyCreated( SUIT_Study* study )
 
   loadDockWindowsState();
 
-  connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
-           this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
-
-
   objectBrowserColumnsVisibility();
 }
 
-/*!Called on Save study operation*/
-void SalomeApp_Application::onStudySaved( SUIT_Study* study )
-{
-  LightApp_Application::onStudySaved( study );
-
-  // temporary commented
-  /*if ( objectBrowser() ) {
-    updateSavePointDataObjects( dynamic_cast<SalomeApp_Study*>( study ) );
-    objectBrowser()->updateTree( study->root() );
-  }*/
-}
-
 /*!Called on Open study operation*/
 void SalomeApp_Application::onStudyOpened( SUIT_Study* study )
 {
@@ -1607,9 +1586,6 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study )
 
   loadDockWindowsState();
 
-  connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
-           this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
-
   objectBrowserColumnsVisibility();
 
   // temporary commented
@@ -1842,80 +1818,6 @@ void SalomeApp_Application::onExtAction()
     printf("Error: Can't Invoke method %s\n", qPrintable(aDataList[1]));
 }
 
-/*!
- * Called when window activated
- */
-void SalomeApp_Application::onWindowActivated( SUIT_ViewWindow* theViewWindow )
-{
-  SUIT_DataBrowser* anOB = objectBrowser();
-  if( !anOB )
-    return;
-  SUIT_DataObject* rootObj = anOB->root();
-  if( !rootObj )
-    return;
-
-  DataObjectList listObj = rootObj->children( true );
-
-  SUIT_ViewModel* vmod = 0;
-  if ( SUIT_ViewManager* vman = theViewWindow->getViewManager() )
-    vmod = vman->getViewModel();
-  updateVisibilityState( listObj, vmod );
-}
-
-/*!
-  Update visibility state of given objects
- */
-void SalomeApp_Application::updateVisibilityState( DataObjectList& theList,
-                                                   SUIT_ViewModel*  theViewModel )
-{
-  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
-
-  if(!theViewModel)
-    return;
-
-  SALOME_View* aView = dynamic_cast<SALOME_View*>( theViewModel );
-
-  if (theList.isEmpty() || !aStudy)
-    return;
-
-  for ( DataObjectList::iterator itr = theList.begin(); itr != theList.end(); ++itr ) {
-    LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>(*itr);
-
-    if (!obj || aStudy->isComponent(obj->entry()))
-      continue;
-
-    LightApp_Module* anObjModule = dynamic_cast<LightApp_Module*>(obj->module());
-    Qtx::VisibilityState anObjState = Qtx::UnpresentableState;
-
-    if(anObjModule) {
-      LightApp_Displayer* aDisplayer = anObjModule->displayer();
-      if(aDisplayer) {
-        if( aDisplayer->canBeDisplayed(obj->entry(), theViewModel->getType()) ) {
-          if(aView && aDisplayer->IsDisplayed(obj->entry(),aView))
-            anObjState = Qtx::ShownState;
-          else
-            anObjState = Qtx::HiddenState;
-        }
-       aStudy->setVisibilityState( obj->entry(), anObjState );
-      }
-    }
-  }
-}
-
-/*!
-  Called then view manager removed
-*/
-void SalomeApp_Application::onViewManagerRemoved( SUIT_ViewManager* )
-{
-  ViewManagerList lst;
-  viewManagers(lst);
-  if( lst.count() == 1) { // in case if closed last view window
-    LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
-    if(aStudy)
-      aStudy->setVisibilityStateForAll(Qtx::UnpresentableState);
-  }
-}
-
 /*!
   Checks that an object can be renamed.
   \param entry entry of the object
index 88f577dcc0c6d4cdb4b9e166152b8c5792c79191..f38b410a4fe5980d1c9cc8c370ef6dbc90205c98 100644 (file)
@@ -34,8 +34,6 @@
 #include "SalomeApp.h"
 #include <LightApp_Application.h>
 
-#include <SUIT_DataObject.h>
-
 #include <omniORB4/CORBA.h>
 
 //#include <SALOMEconfig.h>
 class LightApp_Preferences;
 class SalomeApp_Study;
 #ifndef DISABLE_PYCONSOLE
-  class SalomeApp_NoteBook;
+class SalomeApp_NoteBook;
 #endif
 class SUIT_Desktop;
-
-class SUIT_ViewModel;
 class SALOME_LifeCycleCORBA;
 
 
@@ -118,10 +114,6 @@ public:
   virtual SalomeApp_NoteBook*         getNoteBook() const;
 #endif
 
- //! update visibility state of objects
-  void                                updateVisibilityState( DataObjectList& theList,
-                                                             SUIT_ViewModel* theViewModel );  
-
   virtual bool                        renameAllowed( const QString& ) const;
   virtual bool                        renameObject( const QString&, const QString& );
   
@@ -148,12 +140,8 @@ public slots:
 
 protected slots:
   void                                onStudyCreated( SUIT_Study* );
-  void                                onStudySaved( SUIT_Study* );
   void                                onStudyOpened( SUIT_Study* );
-  void                                onStudyClosed( SUIT_Study* );
   
-  void                                onViewManagerRemoved( SUIT_ViewManager* );
-
 protected:
   virtual void                        createActions();
   virtual SUIT_Study*                 createNewStudy();
@@ -198,8 +186,6 @@ private slots:
   void                                onOpenWith();
   void                                onExtAction();
 
-  void                                onWindowActivated( SUIT_ViewWindow* theViewWindow );
-
 private:
   void                                createExtraActions();
 
index 21e27eb0d1811e15a282f22e6e0a4b07f15ccfcc..2b8fb0ae9bc42ac3bec0ece0c5c8717211f990d6 100644 (file)
@@ -53,8 +53,7 @@
 
 /*!Constructor.*/
 SalomeApp_Module::SalomeApp_Module( const QString& name )
-  : LightApp_Module( name ),
-    myIsFirstActivate( true )
+  : LightApp_Module( name )
 {
 }
 
@@ -141,22 +140,6 @@ void SalomeApp_Module::storeVisualParameters(int savePoint)
 {
 }
 
-
-/*!Activate module.*/
-bool SalomeApp_Module::activateModule( SUIT_Study* theStudy )
-{
-  bool state = LightApp_Module::activateModule( theStudy );
-
-  if (!myIsFirstActivate)
-    return state;
-  
-  updateModuleVisibilityState();
-
-  myIsFirstActivate = false;
-  
-  return state;
-}
-
 /*!
  * \brief Virtual public
  *
@@ -166,94 +149,3 @@ bool SalomeApp_Module::activateModule( SUIT_Study* theStudy )
 void SalomeApp_Module::restoreVisualParameters(int savePoint)
 {
 }
-
-/*! Redefined to reset internal flags valid for study instance */
-void SalomeApp_Module::studyClosed( SUIT_Study* theStudy )
-{
-  LightApp_Module::studyClosed( theStudy );
-  
-  myIsFirstActivate = true;
-  
-  LightApp_Application* app = dynamic_cast<LightApp_Application*>(application());
-  if (!app)
-    return;
-  
-  SUIT_DataBrowser* ob = app->objectBrowser();
-  if (ob && ob->model())
-    disconnect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
-                this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ) );
-}
-
-
-/*!
- * \brief Virtual public slot
- *
- * This method is called after the object inserted into data view to update their visibility state
- * This is default implementation
- */
-void SalomeApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn )
-{
-  if (!isActiveModule())
-    return;
-  // change visibility of object
-  if (!theObject || theColumn != SUIT_DataObject::VisibilityId )
-    return;
-
-  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-  if( !study )
-    return;
-
-  LightApp_DataObject* lo = dynamic_cast<LightApp_DataObject*>(theObject);
-  if(!lo)
-    return;
-  
-  // detect action index (from LightApp level)
-  int id = -1;
-  
-  if ( study->visibilityState(lo->entry()) == Qtx::ShownState )
-    id = myErase;
-  else if ( study->visibilityState(lo->entry()) == Qtx::HiddenState )
-    id = myDisplay;
-  
-  if ( id != -1 )
-    startOperation( id );
-}
-
-
-/*!
-  Called then study closed
-*/
-void SalomeApp_Application::onStudyClosed( SUIT_Study* theStudy){
-  LightApp_Application::onStudyClosed(theStudy);
-
-  disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
-             this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
-}
-
-
-void SalomeApp_Module::updateModuleVisibilityState() {
-
-  // update visibility state of objects
-  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
-  if (!app)
-    return;
-  
-  SUIT_DataBrowser* ob = app->objectBrowser();
-  if (!ob || !ob->model())
-    return;
-
-  // connect to click on item
-  connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
-           this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
-
-  SUIT_DataObject* rootObj = ob->root();
-  if( !rootObj )
-    return;
-  
-  DataObjectList listObj = rootObj->children( true );
-  
-  SUIT_ViewModel* vmod = 0;
-  if ( SUIT_ViewManager* vman = app->activeViewManager() )
-    vmod = vman->getViewModel();
-  app->updateVisibilityState( listObj, vmod );
-}
index d9c0852b292454c9047bfff897b14de5ac52dc7e..2f4c7feeaf3c75d9e4ded8eaa3240c79654e4d8c 100644 (file)
@@ -64,20 +64,9 @@ public:
   virtual void                        restoreVisualParameters(int savePoint);
   virtual LightApp_Selection*         createSelection() const;
   
-  public slots:
-  virtual bool                        activateModule( SUIT_Study* );
-  virtual void                        studyClosed( SUIT_Study* );
-  virtual void                        onObjectClicked( SUIT_DataObject*, int );
-
-  virtual void                        updateModuleVisibilityState();
-
 protected:
   virtual CAM_DataModel*              createDataModel();
   virtual void                        extractContainers( const SALOME_ListIO&, SALOME_ListIO& ) const;
-
-
- protected:
-  bool myIsFirstActivate;
 };
 
 #endif