From 210acdcd3cdcfadc9cb32aba8b36e3ccb93c5f6a Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 23 Jun 2005 10:50:57 +0000 Subject: [PATCH] Fix for bug IPAL9277(3.0.0 (debianex): incorrect cursor view after "Activate Module" applying from the multi-selection popup). --- src/SalomeApp/SalomeApp_Application.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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() ) ); } -- 2.39.2