From a89670bc22988b18bd3c6578da0140aa64c41bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 28 Oct 2019 17:26:33 +0100 Subject: [PATCH] #4892 Set As Primary Linked View disabled for unlinked views, to reduce clutter in menu --- .../ViewLink/RicSetMasterViewFeature.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp b/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp index 4ccd95f370..f22208abeb 100644 --- a/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp +++ b/ApplicationCode/Commands/ViewLink/RicSetMasterViewFeature.cpp @@ -30,6 +30,7 @@ #include "Riu3DMainWindowTools.h" +#include "RimGeoMechContourMapView.h" #include #include @@ -42,23 +43,13 @@ bool RicSetMasterViewFeature::isCommandEnabled() { RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView(); if ( !activeView ) return false; + if ( dynamic_cast( activeView ) != nullptr ) return false; + if ( dynamic_cast( activeView ) != nullptr ) return false; - RimProject* proj = RiaApplication::instance()->project(); RimViewLinker* viewLinker = activeView->assosiatedViewLinker(); - if ( viewLinker && viewLinker->masterView() == activeView ) - { - return false; - } - if ( !proj->viewLinkerCollection()->viewLinker() ) - { - return false; - } - - if ( dynamic_cast( activeView ) != nullptr ) - { - return false; - } + if ( !viewLinker ) return false; + if ( viewLinker->masterView() == activeView ) return false; return true; }