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 "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
|
#include "RimGeoMechContourMapView.h"
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
@@ -42,23 +43,13 @@ bool RicSetMasterViewFeature::isCommandEnabled()
|
|||||||
{
|
{
|
||||||
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||||
if ( !activeView ) return false;
|
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();
|
RimViewLinker* viewLinker = activeView->assosiatedViewLinker();
|
||||||
if ( viewLinker && viewLinker->masterView() == activeView )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !proj->viewLinkerCollection()->viewLinker() )
|
if ( !viewLinker ) return false;
|
||||||
{
|
if ( viewLinker->masterView() == activeView ) return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dynamic_cast<RimEclipseContourMapView*>( activeView ) != nullptr )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user