Salome HOME
Fix bug 10955: Collisions with 'Ctrl+I' and 'Ctrl+M' hot keys. T3_2_0b1 V3_2_0b1
authorjfa <jfa@opencascade.com>
Wed, 10 May 2006 14:27:12 +0000 (14:27 +0000)
committerjfa <jfa@opencascade.com>
Wed, 10 May 2006 14:27:12 +0000 (14:27 +0000)
src/GEOMGUI/GeometryGUI.cxx

index 31c71174475343b627d009bb24a74cfffa91b199..e81e7099f623e9cc05617817d3f675fbb09287f6 100644 (file)
@@ -732,8 +732,8 @@ void GeometryGUI::createGeomAction( const int id, const QString& po_id, const QS
 
 
 //=======================================================================
-// function : GeometryGUI::Deactivate()
-// purpose  : Called when GEOM module is deactivated [ static ]
+// function : GeometryGUI::initialize()
+// purpose  : Called when GEOM module is created
 //=======================================================================
 void GeometryGUI::initialize( CAM_Application* app )
 {
@@ -1105,8 +1105,8 @@ void GeometryGUI::initialize( CAM_Application* app )
 }
 
 //=======================================================================
-// function : GeometryGUI::Deactivate()
-// purpose  : Called when GEOM module is deactivated [ static ]
+// function : GeometryGUI::activateModule()
+// purpose  : Called when GEOM module is activated
 //=======================================================================
 bool GeometryGUI::activateModule( SUIT_Study* study )
 {
@@ -1121,9 +1121,15 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
   setMenuShown( true );
   setToolShown( true );
 
-  connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), 
+  connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
          this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
 
+  // Reset actions accelerator keys
+  //action(111)->setAccel(QKeySequence(CTRL + Key_I)); // Import
+  //action(121)->setAccel(QKeySequence(CTRL + Key_E)); // Export
+  action(111)->setEnabled(true); // Import
+  action(121)->setEnabled(true); // Export
+
   GUIMap::Iterator it;
   for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
     it.data()->activate( application()->desktop() );
@@ -1142,19 +1148,19 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
   getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
   for ( GEOMGUI_OCCSelector* sr = myOCCSelectors.first(); sr; sr = myOCCSelectors.next() )
     sr->setEnabled(true);
-  
+
   // disable VTK selectors
   getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
   for ( LightApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
     sr->setEnabled(true);
-  
+
   return true;
 }
 
 
 //=======================================================================
-// function : GeometryGUI::Deactivate()
-// purpose  : Called when GEOM module is deactivated [ static ]
+// function : GeometryGUI::deactivateModule()
+// purpose  : Called when GEOM module is deactivated
 //=======================================================================
 bool GeometryGUI::deactivateModule( SUIT_Study* study )
 {
@@ -1170,6 +1176,12 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
   for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
     it.data()->deactivate();  
 
+  // Unset actions accelerator keys
+  //action(111)->setAccel(QKeySequence()); // Import
+  //action(121)->setAccel(QKeySequence()); // Export
+  action(111)->setEnabled(false); // Import
+  action(121)->setEnabled(false); // Export
+
   myOCCSelectors.clear();
   getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() );
 
@@ -1491,7 +1503,7 @@ void GeometryGUI::BuildPresentation( const Handle(SALOME_InteractiveObject)& io,
 }
 
 //=======================================================================
-// function : setCommandsEnabled()
+// function : onWindowActivated()
 // purpose  : update menu items' status - disable non-OCC-viewer-compatible actions
 //=======================================================================
 void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win )