#3255 Replace code that duplicates functionality in caf::SelectionManager

This commit is contained in:
Gaute Lindkvist
2018-08-22 12:04:42 +02:00
parent 12202fe4e6
commit 445e134d49
7 changed files with 18 additions and 55 deletions

View File

@@ -50,7 +50,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogFileCurveFeature, "RicNewWellLogFileCurveFeatur
bool RicNewWellLogFileCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
return (RicWellLogTools::selectedWellLogPlotTrack() != nullptr && wellLogFilesAvailable()) || RicWellLogTools::selectedWellPathWithLogFile() != nullptr;
return (caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellLogTrack>() != nullptr && wellLogFilesAvailable()) || RicWellLogTools::selectedWellPathWithLogFile() != nullptr;
}
//--------------------------------------------------------------------------------------------------
@@ -58,7 +58,7 @@ bool RicNewWellLogFileCurveFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewWellLogFileCurveFeature::onActionTriggered(bool isChecked)
{
RimWellLogTrack* wellLogPlotTrack = RicWellLogTools::selectedWellLogPlotTrack();
RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellLogTrack>();
if (wellLogPlotTrack)
{
RicWellLogTools::addFileCurve(wellLogPlotTrack);