mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added close on context menu for reservoir case
p4#: 19266
This commit is contained in:
@@ -142,6 +142,12 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
|
||||
menu.addAction(QString("Write"), this, SLOT(slotWriteBinaryResultAsInputProperty()));
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
else if (dynamic_cast<RimReservoir*>(uiItem->dataObject().p()))
|
||||
{
|
||||
QMenu menu;
|
||||
menu.addAction(QString("Close"), this, SLOT(slotCloseCase()));
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -729,3 +735,15 @@ void RimUiTreeView::slotWriteBinaryResultAsInputProperty()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimUiTreeView::slotCloseCase()
|
||||
{
|
||||
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
|
||||
if (myModel)
|
||||
{
|
||||
myModel->deleteReservoir(currentIndex());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user