-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
*/
bool CAM_Module::activateModule( SUIT_Study* /*study*/ )
{
+ // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys
+ // after activate/deactivate modules
+ for ( QMap<QAction*, QKeySequence>::Iterator it = myActionShortcutMap.begin(); it != myActionShortcutMap.end(); ++it )
+ {
+ // Reset actions accelerator keys
+ it.key()->setShortcut( it.value() );
+ }
+ myActionShortcutMap.clear();
return true;
}
*/
bool CAM_Module::deactivateModule( SUIT_Study* )
{
+ // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys
+ // after activate/deactivate modules
+ myActionShortcutMap.clear();
+ for ( QMap<int, QAction*>::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it )
+ {
+ myActionShortcutMap.insert( it.value(), it.value()->shortcut() );
+ it.value()->setShortcut( QKeySequence() );
+ }
return true;
}
If the toolbar has been already created, its ID is just returned.
- \param name toolbar name
+ \param title toolbar title
+ \param name toolbar name (identifier)
\return toolbar ID or -1 if toolbar could not be created
*/
-int CAM_Module::createTool( const QString& name )
+int CAM_Module::createTool( const QString& title, const QString& name )
{
if ( !toolMgr() )
return -1;
ActionMgrLocker lock( toolMgr(), !myToolShown );
- return toolMgr()->createToolBar( name, myToolShown );
+ return toolMgr()->createToolBar( title, name );
}
/*!
\return menu item ID or -1 if menu item could not be added
*/
int CAM_Module::createMenu( const QString& subMenu, const int menu,
- const int id, const int group, const int idx )
+ const int id, const int group, const int idx, QMenu * menuObj )
{
if ( !menuMgr() )
return -1;
- return menuMgr()->insert( subMenu, menu, group, id, idx );
+ return menuMgr()->insert( subMenu, menu, group, id, idx, menuObj );
}
/*!
const QString& menu, const QString& tip, const int key,
QObject* parent, const bool toggle, QObject* reciever,
const char* member, const QString& shortcutAction )
+{
+ return createAction( id, text, icon, menu, tip, QKeySequence(key), parent, toggle, reciever, member, shortcutAction );
+}
+
+/*!
+ \brief Create new instance of QtxAction and register action with specified \a id.
+
+ Resulting action ID may differ from the requested one. This can happen if
+ requested ID is already in use.
+
+ If \a id < 0, the action ID is generated automatically.
+
+ \param id required action ID
+ \param text tooltip text
+ \param icon action icon
+ \param menu menu text
+ \param tip status bar tip
+ \param key keyboard accelerator
+ \param parent parent object
+ \param toggle if \c true, the action will be toggled
+ \param reciever action activation signal receiver object
+ \param member action activation signal receiver slot
+*/
+QAction* CAM_Module::createAction( const int id, const QString& text, const QIcon& icon,
+ const QString& menu, const QString& tip, const QKeySequence& key,
+ QObject* parent, const bool toggle, QObject* reciever,
+ const char* member, const QString& shortcutAction )
{
QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
a->setStatusTip( tip );
\fn void CAM_Module::updateCommandsStatus();
\brief Update menu/toolbar actions.
*/
+
+
+bool CAM_Module::abortAllOperations()
+{
+ return true;
+}