mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#396) Enabling "Delete" for well log plot traces only if there are multiple traces
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
#include "RicDeleteItemExec.h"
|
||||
#include "RicDeleteItemExecData.h"
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotTrace.h"
|
||||
|
||||
#include "cafCmdExecCommandManager.h"
|
||||
#include "cafCmdSelectionHelper.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
@@ -46,6 +49,20 @@ bool RicDeleteItemFeature::isCommandEnabled()
|
||||
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>(currentPdmObject->parentField());
|
||||
if (!childArrayFieldHandle) return false;
|
||||
|
||||
if (dynamic_cast<RimWellLogPlotTrace*>(currentPdmObject))
|
||||
{
|
||||
RimWellLogPlotTrace* plotTrace = dynamic_cast<RimWellLogPlotTrace*>(currentPdmObject);
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
plotTrace->firstAnchestorOrThisOfType(wellLogPlot);
|
||||
if (wellLogPlot)
|
||||
{
|
||||
if (wellLogPlot->traceCount() < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user