#13376 Well Target Table: Fix menu visibility.

Introduced in ae8446073b.

Fixes #13376.
This commit is contained in:
Kristian Bendiksen authored and Magne Sjaastad committed 2025-12-22 14:08:57 +01:00
1 parent 405a32e2da
commit 43755feb42
1 file changed
+6 -4
@@ -17,8 +17,6 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RicDeleteWellPathTargetFeature.h"
CAF_CMD_SOURCE_INIT( RicDeleteWellPathTargetFeature, "RicDeleteWellPathTargetFeature" );
#include "RimModeledWellPath.h"
#include "RimWellPathGeometryDef.h"
#include "RimWellPathTarget.h"
@@ -27,12 +25,15 @@ CAF_CMD_SOURCE_INIT( RicDeleteWellPathTargetFeature, "RicDeleteWellPathTargetFea
#include <QAction>
CAF_CMD_SOURCE_INIT( RicDeleteWellPathTargetFeature, "RicDeleteWellPathTargetFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDeleteWellPathTargetFeature::isCommandEnabled() const
{
const auto targets = caf::SelectionManager::instance()->objectsByType<RimWellPathTarget>();
const auto targets =
caf::SelectionManager::instance()->objectsByType<RimWellPathTarget>( caf::SelectionManager::SelectionLevel::FIRST_LEVEL );
return !targets.empty();
}
@@ -41,7 +42,8 @@ bool RicDeleteWellPathTargetFeature::isCommandEnabled() const
//--------------------------------------------------------------------------------------------------
void RicDeleteWellPathTargetFeature::onActionTriggered( bool isChecked )
{
const auto targets = caf::SelectionManager::instance()->objectsByType<RimWellPathTarget>();
const auto targets =
caf::SelectionManager::instance()->objectsByType<RimWellPathTarget>( caf::SelectionManager::SelectionLevel::FIRST_LEVEL );
if ( !targets.empty() )
{
RimWellPathGeometryDef* wellGeomDef = targets[0]->firstAncestorOrThisOfTypeAsserted<RimWellPathGeometryDef>();