mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2162 Context menu: Move new property filter slot to command feature
This commit is contained in:
@@ -245,28 +245,11 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
menu.addSeparator();
|
||||
|
||||
|
||||
menuBuilder << "RicEclipsePropertyFilterNewInViewFeature";
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p());
|
||||
if (eclipseView)
|
||||
{
|
||||
RimEclipseCellColors* cellColors = eclipseView->cellResult().p();
|
||||
if (cellColors)
|
||||
{
|
||||
QAction* propertyAction = new QAction(QIcon(":/CellFilter_Values.png"), QString("Add Property Filter"), this);
|
||||
connect(propertyAction, SIGNAL(triggered()), SLOT(slotAddEclipsePropertyFilter()));
|
||||
|
||||
bool isPerCellFaceResult = RiaDefines::isPerCellFaceResult(cellColors->resultVariable());
|
||||
if (isPerCellFaceResult)
|
||||
{
|
||||
propertyAction->setEnabled(false);
|
||||
}
|
||||
|
||||
if (!viewController || !viewController->isPropertyFilterOveridden())
|
||||
{
|
||||
menu.addAction(propertyAction);
|
||||
}
|
||||
}
|
||||
|
||||
// Hide faults command
|
||||
const RigFault* fault = eclipseView->mainGrid()->findFaultFromCellIndexAndCellFace(m_currentCellIndex, m_currentFaceIndex);
|
||||
if (fault)
|
||||
@@ -405,20 +388,6 @@ void RiuViewerCommands::slotHideFault()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::slotAddEclipsePropertyFilter()
|
||||
{
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p());
|
||||
if (eclipseView)
|
||||
{
|
||||
RimEclipsePropertyFilterCollection* filterCollection = eclipseView->eclipsePropertyFilterCollection();
|
||||
RicEclipsePropertyFilterNewExec* propCmdExe = new RicEclipsePropertyFilterNewExec(filterCollection);
|
||||
caf::CmdExecCommandManager::instance()->processExecuteCommand(propCmdExe);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user