From 4de95c2092cd34b7c0482c6e538cf336acae9082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Fri, 23 Oct 2015 14:28:21 +0200 Subject: [PATCH] (#578) Controlled views: Disabled the range filter commands in the treeview --- .../Commands/RicRangeFilterFeatureImpl.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/Commands/RicRangeFilterFeatureImpl.cpp b/ApplicationCode/Commands/RicRangeFilterFeatureImpl.cpp index 8b89bd242b..1a5cb04ed7 100644 --- a/ApplicationCode/Commands/RicRangeFilterFeatureImpl.cpp +++ b/ApplicationCode/Commands/RicRangeFilterFeatureImpl.cpp @@ -26,13 +26,27 @@ #include "cafSelectionManager.h" #include +#include "RimView.h" +#include "RimViewController.h" //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RicRangeFilterFeatureImpl::isRangeFilterCommandAvailable() { - return findRangeFilterCollection() != NULL; + RimCellRangeFilterCollection* rangeFilterCollection = findRangeFilterCollection(); + if (!rangeFilterCollection) return false; + + RimView* view; + rangeFilterCollection->firstAnchestorOrThisOfType(view); + if (view) + { + RimViewController* vc = view->viewController(); + if (!vc) return true; + return (!vc->isRangeFiltersControlled()); + } + + return true; } //--------------------------------------------------------------------------------------------------