mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#518) Removed link visible views from 3DView context menu
Modified the command enabled state to be enabled only when it is sensible to run it. (Unlinked views is present.)
This commit is contained in:
@@ -47,10 +47,17 @@ CAF_CMD_SOURCE_INIT(RicLinkVisibleViewsFeature, "RicLinkVisibleViewsFeature");
|
||||
bool RicLinkVisibleViewsFeature::isCommandEnabled()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimView*> views;
|
||||
proj->allVisibleViews(views);
|
||||
std::vector<RimView*> visibleViews;
|
||||
std::vector<RimView*> linkedviews;
|
||||
|
||||
if (views.size() > 1) return true;
|
||||
proj->allVisibleViews(visibleViews);
|
||||
if (proj->viewLinkerCollection() && proj->viewLinkerCollection()->viewLinker())
|
||||
{
|
||||
proj->viewLinkerCollection()->viewLinker()->allViews(linkedviews);
|
||||
}
|
||||
|
||||
|
||||
if (visibleViews.size() >= 2 && (linkedviews.size() < visibleViews.size())) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user