Salome HOME
Updated copyright comment
[modules/gui.git] / src / SUIT / SUIT_ActionOperation.cxx
index c003ec5ac8233d3c1d6d28623fb2bc67592f0f03..87ac8576b87bcdfb0f748224cfeaaf496a362ab8 100644 (file)
@@ -1,3 +1,25 @@
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #include "SUIT_ActionOperation.h"
 
 #include "SUIT_Application.h"
@@ -31,20 +53,20 @@ QtxAction* SUIT_ActionOperation::action() const
 /*!Set action.
  * Create new instance of QtxAction and set.
  */
-void SUIT_ActionOperation::setAction( const QString& text, const QIconSet& icon,
-                                     const QString& menuText, QKeySequence accel,
-                                      QObject* parent, const char* name, bool toggle )
+void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
+                                      const QString& menuText, QKeySequence accel,
+                                      QObject* parent, bool toggle )
 {
-  setAction( new QtxAction( text, icon, menuText, accel, parent, name, toggle ) );
+  setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) );
 }
 
 /*!Set action.
  * Create new instance of QtxAction and set.
  */
 void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
-                                     QKeySequence accel, QObject* parent, const char* name, bool toggle )
+                                      QKeySequence accel, QObject* parent, bool toggle )
 {
-  setAction( new QtxAction(text, menuText, accel, parent, name, toggle ) );
+  setAction( new QtxAction( text, menuText, accel, parent, toggle ) );
 }
 
 /*!Set action.
@@ -58,29 +80,19 @@ void SUIT_ActionOperation::setAction( QtxAction* a )
   myAction = a;
 
   myAction->setEnabled( application()->activeStudy() );
-  connect( myAction, SIGNAL( activated() ), SLOT( start() ) );
+  connect( myAction, SIGNAL( triggered() ), SLOT( start() ) );
 }
 
 /*! Add action to widget \a wid.
- *\retval TRUE - successful, FALSE - not successful.
+ *\retval true - successful, false - not successful.
  */
 bool SUIT_ActionOperation::addTo( QWidget* wid )
 {
   if ( !action() )
     return false;
 
-  return action()->addTo( wid );
-}
-
-/*! Add action to widget \a wid.
- *\retval TRUE - successful, FALSE - not successful.
- */
-bool SUIT_ActionOperation::addTo( QWidget* wid, int idx )
-{
-  if ( !action() )
-    return false;
-
-  return action()->addTo( wid, idx );
+  wid->addAction( action() );
+  return true;
 }
 
 /*! Set status tip for action.