(#446) "Link view" only available if linked views exist

This commit is contained in:
Pål Hagen 2015-09-22 14:23:51 +02:00
parent ae1cc96979
commit d377de562a

View File

@ -25,6 +25,8 @@
#include "RimProject.h"
#include "RimView.h"
#include "RimViewLinkerCollection.h"
#include "RimViewLinker.h"
#include "cafSelectionManager.h"
@ -43,7 +45,18 @@ bool RicLinkViewFeature::isCommandEnabled()
RimProject* proj = RiaApplication::instance()->project();
if (!proj->findViewLinkerFromView(activeView))
{
return true;
RimViewLinkerCollection* viewLinkerCollection = proj->viewLinkerCollection();
if (viewLinkerCollection)
{
RimViewLinker* viewLinker = viewLinkerCollection->viewLinker();
if (viewLinker)
{
if (viewLinker->viewLinks().size() > 0)
{
return true;
}
}
}
}
return false;