#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

@@ -37,6 +37,8 @@
#include <QAction>
#include <QString>
#include "cafSelectionManager.h"
#include <vector>
@@ -48,7 +50,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogRftCurveFeature, "RicNewWellLogRftCurveFeature"
bool RicNewWellLogRftCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
if (RicWellLogTools::selectedWellLogPlotTrack() != nullptr)
if (caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>() != nullptr)
{
return true;
}
@@ -69,7 +71,7 @@ bool RicNewWellLogRftCurveFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewWellLogRftCurveFeature::onActionTriggered(bool isChecked)
{
RimWellLogTrack* wellLogPlotTrack = RicWellLogTools::selectedWellLogPlotTrack();
RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>();
if (wellLogPlotTrack)
{
int branchIdx;