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:
parent
ecc69e7a1a
commit
5b9bf3bcd2
@ -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;
|
||||
}
|
||||
|
@ -230,7 +230,6 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
{
|
||||
QStringList commandIds;
|
||||
|
||||
commandIds << "RicLinkVisibleViewsFeature";
|
||||
commandIds << "RicLinkViewFeature";
|
||||
commandIds << "RicUnLinkViewFeature";
|
||||
commandIds << "RicShowLinkOptionsFeature";
|
||||
|
Loading…
Reference in New Issue
Block a user