1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #include "SUIT_ActionOperation.h"
21 #include "SUIT_Application.h"
23 #include <QtxAction.h>
28 SUIT_ActionOperation::SUIT_ActionOperation( SUIT_Application* app )
29 : SUIT_Operation( app ),
37 SUIT_ActionOperation::~SUIT_ActionOperation()
44 QtxAction* SUIT_ActionOperation::action() const
50 * Create new instance of QtxAction and set.
52 void SUIT_ActionOperation::setAction( const QString& text, const QIconSet& icon,
53 const QString& menuText, QKeySequence accel,
54 QObject* parent, const char* name, bool toggle )
56 setAction( new QtxAction( text, icon, menuText, accel, parent, name, toggle ) );
60 * Create new instance of QtxAction and set.
62 void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
63 QKeySequence accel, QObject* parent, const char* name, bool toggle )
65 setAction( new QtxAction(text, menuText, accel, parent, name, toggle ) );
70 void SUIT_ActionOperation::setAction( QtxAction* a )
78 myAction->setEnabled( application()->activeStudy() );
79 connect( myAction, SIGNAL( activated() ), SLOT( start() ) );
82 /*! Add action to widget \a wid.
83 *\retval TRUE - successful, FALSE - not successful.
85 bool SUIT_ActionOperation::addTo( QWidget* wid )
90 return action()->addTo( wid );
93 /*! Add action to widget \a wid.
94 *\retval TRUE - successful, FALSE - not successful.
96 bool SUIT_ActionOperation::addTo( QWidget* wid, int idx )
101 return action()->addTo( wid, idx );
104 /*! Set status tip for action.
106 void SUIT_ActionOperation::setStatusTip( const QString& tip )
109 action()->setStatusTip( tip );