(#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:
Jacob Støren 2015-09-25 15:22:55 +02:00
parent ecc69e7a1a
commit 5b9bf3bcd2
2 changed files with 10 additions and 4 deletions

View File

@ -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;
}

View File

@ -230,7 +230,6 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
{
QStringList commandIds;
commandIds << "RicLinkVisibleViewsFeature";
commandIds << "RicLinkViewFeature";
commandIds << "RicUnLinkViewFeature";
commandIds << "RicShowLinkOptionsFeature";