From: mzn Date: Thu, 23 Jun 2005 10:50:57 +0000 (+0000) Subject: Fix for bug IPAL9277(3.0.0 (debianex): incorrect cursor view after "Activate Module... X-Git-Tag: T3_0_0_a4~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=210acdcd3cdcfadc9cb32aba8b36e3ccb93c5f6a;p=modules%2Fgui.git Fix for bug IPAL9277(3.0.0 (debianex): incorrect cursor view after "Activate Module" applying from the multi-selection popup). --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 61a264035..3f9eb7c30 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -629,7 +629,11 @@ void SalomeApp_Application::onOpenWith() SALOME_ListIO aList; SalomeApp_SelectionMgr* mgr = selectionMgr(); mgr->selectedObjects(aList); - if (aList.Extent() > 1) return; + if (aList.Extent() != 1) + { + QApplication::restoreOverrideCursor(); + return; + } Handle(SALOME_InteractiveObject) aIObj = aList.First(); QString aModuleName(aIObj->getComponentDataType()); QString aModuleTitle = moduleTitle(aModuleName); @@ -1536,6 +1540,22 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t CAM_Application::contextMenuPopup( type, thePopup, title ); thePopup->insertSeparator(); thePopup->insertItem( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) ); + + // "Activate module" item should appear only if it's necessary + OB_Browser* ob = objectBrowser(); + if ( !ob || type != ob->popupClientType() ) + return; + SALOME_ListIO aList; + SalomeApp_SelectionMgr* mgr = selectionMgr(); + mgr->selectedObjects(aList); + if (aList.Extent() != 1) + return; + Handle(SALOME_InteractiveObject) aIObj = aList.First(); + QString aModuleName(aIObj->getComponentDataType()); + QString aModuleTitle = moduleTitle(aModuleName); + CAM_Module* currentModule = activeModule(); + if (currentModule && currentModule->moduleName() == aModuleTitle) + return; thePopup->insertItem( tr( "MEN_OPENWITH" ), this, SLOT( onOpenWith() ) ); }