From: stv Date: Mon, 24 Sep 2007 12:29:41 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4b5bddc82c24364b95516d72ecacfbfeced8f0e8;p=modules%2Fgui.git *** empty log message *** --- diff --git a/src/Qtx/QtxActionMenuMgr.cxx b/src/Qtx/QtxActionMenuMgr.cxx index f3b42a46d..2540721e3 100644 --- a/src/Qtx/QtxActionMenuMgr.cxx +++ b/src/Qtx/QtxActionMenuMgr.cxx @@ -1027,9 +1027,9 @@ bool QtxActionMenuMgr::load( const QString& fname, QtxActionMgr::Reader& r ) \param pid parent menu item ID \return \c true if parent menu item contains such child item */ -bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid ) const +bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid, const bool rec ) const { - return (bool)find( title, pid, false ); + return (bool)find( title, pid, rec ); } /*! @@ -1038,9 +1038,9 @@ bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid ) const \param pid parent menu item ID \return \c true if parent menu item contains such child item */ -bool QtxActionMenuMgr::containsMenu( const int id, const int pid ) const +bool QtxActionMenuMgr::containsMenu( const int id, const int pid, const bool rec ) const { - return (bool)find( id, pid, false ); + return (bool)find( id, pid, rec ); } /*! diff --git a/src/Qtx/QtxActionMenuMgr.h b/src/Qtx/QtxActionMenuMgr.h index 96d15b51b..1f5079161 100644 --- a/src/Qtx/QtxActionMenuMgr.h +++ b/src/Qtx/QtxActionMenuMgr.h @@ -90,8 +90,8 @@ public: virtual bool load( const QString&, QtxActionMgr::Reader& ); - bool containsMenu( const QString&, const int ) const; - bool containsMenu( const int, const int ) const; + bool containsMenu( const QString&, const int, const bool = false ) const; + bool containsMenu( const int, const int, const bool = false ) const; QMenu* findMenu( const int ) const; diff --git a/src/SUIT/SUIT_Application.cxx b/src/SUIT/SUIT_Application.cxx index a5e545230..0497a7a9e 100755 --- a/src/SUIT/SUIT_Application.cxx +++ b/src/SUIT/SUIT_Application.cxx @@ -557,6 +557,16 @@ int SUIT_Application::actionId( const QAction* a ) const return id; } +QList SUIT_Application::actions() const +{ + return myActionMap.values(); +} + +QList SUIT_Application::actionIds() const +{ + return myActionMap.keys(); +} + /*! Creates action and registers it both in menu manager and tool manager \return new instance of action @@ -572,11 +582,12 @@ int SUIT_Application::actionId( const QAction* a ) const \param member - slot to be called when action is activated */ QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon, - const QString& menu, const QString& tip, const int key, + const QString& menu, const QString& tip, const QKeySequence& key, QObject* parent, const bool toggle, QObject* reciever, const char* member ) { - QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle ); + QtxAction* a = new QtxAction( text, icon, menu, 0, parent, toggle ); a->setStatusTip( tip ); + a->setShortcut( key ); if ( reciever && member ) connect( a, SIGNAL( triggered( bool ) ), reciever, member ); diff --git a/src/SUIT/SUIT_Application.h b/src/SUIT/SUIT_Application.h index 710d3b2d5..1e493b487 100755 --- a/src/SUIT/SUIT_Application.h +++ b/src/SUIT/SUIT_Application.h @@ -29,11 +29,12 @@ class QLabel; class QString; class QAction; class QWidget; +class QKeySequence; +class SUIT_Study; class SUIT_Desktop; class SUIT_ViewModel; class SUIT_ResourceMgr; -class SUIT_Study; #ifdef WIN32 #pragma warning ( disable:4251 ) @@ -152,9 +153,13 @@ protected: static QAction* separator(); QAction* action( const int ) const; int actionId( const QAction* ) const; + + QList actions() const; + QList actionIds() const; + int registerAction( const int, QAction* ); QAction* createAction( const int, const QString&, const QIcon&, const QString&, - const QString&, const int, QObject* = 0, + const QString&, const QKeySequence&, QObject* = 0, const bool = false, QObject* = 0, const char* = 0 ); protected slots: