mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4892 Set As Primary Linked View disabled for unlinked views,
to reduce clutter in menu
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include <QAction>
|
||||
#include <QTreeView>
|
||||
|
||||
@@ -42,23 +43,13 @@ bool RicSetMasterViewFeature::isCommandEnabled()
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||
if ( !activeView ) return false;
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( activeView ) != nullptr ) return false;
|
||||
if ( dynamic_cast<RimGeoMechContourMapView*>( 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<RimEclipseContourMapView*>( activeView ) != nullptr )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !viewLinker ) return false;
|
||||
if ( viewLinker->masterView() == activeView ) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user