]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
IPAL21558 In Group creation dialog, selection of sub-shapes in OB, viewer and dialog...
authordmv <dmv@opencascade.com>
Fri, 5 Feb 2010 09:27:30 +0000 (09:27 +0000)
committerdmv <dmv@opencascade.com>
Fri, 5 Feb 2010 09:27:30 +0000 (09:27 +0000)
src/LightApp/LightApp_Selection.cxx
src/LightApp/LightApp_Selection.h

index b39d13121d6ff1f071b87f1e818dd3d1781a3742..6931c9585759c62d8f4c276c7cbba4f18cc4d73e 100644 (file)
@@ -101,8 +101,14 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
         entries.insert( entry, 0 );
         myEntries.insert( num, entry );
         myIsReferences.insert( num, sowner->entry() != entry );
-        processOwner( sowner );
-        num++;
+        if (processOwner( sowner )) {
+          num++;
+        }
+        else {
+          entries.remove( entry );
+          myEntries.remove( num );
+          myIsReferences.remove( num );
+        }
       }
     }
   }
@@ -204,10 +210,17 @@ QVariant LightApp_Selection::parameter( const QString& p ) const
 }
 
 /*!
-  Do nothing. To be redefined by successors
+  Perform additional processing of the selected item (to be redefined by successors if necessary).
+  Returns \c true by default.
+  Note: if this method returns \c false, the item will be removed from the items list and
+  not taken into account when showing popup menu.
+
+  \param owner a data owner being processed
+  \return \c true if the owner should be collected and \c false otherwise
 */
-void LightApp_Selection::processOwner( const LightApp_DataOwner* )
+bool LightApp_Selection::processOwner( const LightApp_DataOwner* /*owner*/ )
 {
+  return true;
 }
 
 /*!
index 4642a87935d363bf48dd5c44eb84cba25b591416..5e2e17a19c84166ffb4dd342558d8ee2841711f7 100644 (file)
@@ -50,7 +50,7 @@ public:
   virtual ~LightApp_Selection();
 
   virtual void                   init( const QString&, LightApp_SelectionMgr* );
-  virtual void                   processOwner( const LightApp_DataOwner* );
+  virtual bool                   processOwner( const LightApp_DataOwner* );
 
   virtual int                    count() const;
   virtual QVariant               parameter( const int, const QString& ) const;