From: imn Date: Thu, 1 Oct 2015 14:01:20 +0000 (+0300) Subject: Additional fix for the INT PAL '52621: Module's shortcuts are enabled even when modul... X-Git-Tag: NewGEOM_1.4.0_a~5^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=24bfdd36540f54ffc559bc87ea0b97534a87d713;p=modules%2Fgui.git Additional fix for the INT PAL '52621: Module's shortcuts are enabled even when module is not active' issue. --- diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index d3a0ddaf1..5ad1dad48 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -234,11 +234,10 @@ 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, QKeySequence>::Iterator it = myActionShortcutMap.begin(); it != myActionShortcutMap.end(); ++it ) + for ( QMap::Iterator it = myActionShortcutMap.begin(); it != myActionShortcutMap.end(); ++it ) { - myActionMap.insert( it.key().first, it.key().second ); // Reset actions accelerator keys - it.key().second->setShortcut( it.value() ); + it.key()->setShortcut( it.value() ); } myActionShortcutMap.clear(); return true; @@ -263,9 +262,9 @@ bool CAM_Module::deactivateModule( SUIT_Study* ) myActionShortcutMap.clear(); for ( QMap::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it ) { - myActionShortcutMap.insert( qMakePair( it.key(), it.value() ), it.value()->shortcut() ); + myActionShortcutMap.insert( it.value(), it.value()->shortcut() ); + it.value()->setShortcut( QKeySequence() ); } - myActionMap.clear(); return true; } diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index 952f18571..69c541505 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -143,7 +143,7 @@ protected: bool unregisterAction( QAction* ); // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys // after activate/deactivate modules - QMap, QKeySequence> myActionShortcutMap; //!< copy actions shortcut map + QMap myActionShortcutMap; //!< copy actions shortcut map virtual bool abortAllOperations();