From: ouv Date: Sat, 12 May 2012 12:23:26 +0000 (+0000) Subject: Bug IPAL22876: TC6.5.0: Show error is absent in popup menu for multiply selection X-Git-Tag: V6_5_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_siman_phase1;p=modules%2Fvisu.git Bug IPAL22876: TC6.5.0: Show error is absent in popup menu for multiply selection --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 47610c14..a8c76b6b 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -3528,7 +3528,7 @@ VisuGUI mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}" ); mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" ); - aRule = "isPlot2dViewer and isVisible and selcount=1 and type='VISU::TCURVE' and hasDeviation"; + aRule = "isPlot2dViewer and isVisible and selcount > 0 and type='VISU::TCURVE' and hasDeviation"; mgr->setRule (action(VISU_SHOW_DEVIATION), aRule , QtxPopupMgr::VisibleRule); aRule = "isPlot2dViewer and isVisible and selcount > 0 and type='VISU::TCURVE' and hasDeviation and isDeviationDisplayed"; mgr->setRule (action(VISU_SHOW_DEVIATION), aRule , QtxPopupMgr::ToggleRule); @@ -4980,22 +4980,31 @@ bool VisuGUI::renameAllowed( const QString& entry) const { void VisuGUI::OnShowDeviation() { - VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this); - if(aSelectionInfo.size() != 1) + if(IsStudyLocked(GetCStudy(GetAppStudy(this)))) return; - VISU::TSelectionItem aSelectionItem = aSelectionInfo.front(); - Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO; - VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase; - if(!aBase) + QAction* anAction = action(VISU_SHOW_DEVIATION); + if(!anAction) return; - if(aBase->GetType() == VISU::TCURVE) { - if(!IsStudyLocked(GetCStudy(GetAppStudy(this)))){ + bool anIsShow = anAction->isChecked(); + + VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this); + if(aSelectionInfo.empty()) + return; + + TSelectionInfo::iterator anIter = aSelectionInfo.begin(); + for( ; anIter != aSelectionInfo.end(); anIter++ ) + { + VISU::TSelectionItem aSelectionItem = *anIter; + Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO; + VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase; + if(aBase && aBase->GetType() == VISU::TCURVE) { // Curve object if(VISU::Curve_i* aCurve = dynamic_cast(aBase)) { - aCurve->ShowDeviation(!aCurve->isDeviationShown()); - PlotCurve(this, aCurve, VISU::eDisplay); + aCurve->ShowDeviation(anIsShow); + if( displayer()->IsDisplayed( anIO->getEntry() ) ) + PlotCurve(this, aCurve, VISU::eDisplay); } } }