Added close on context menu for reservoir case

p4#: 19266
This commit is contained in:
Magne Sjaastad
2012-10-23 11:12:47 +02:00
parent f4a328b4cb
commit f833244b68
5 changed files with 55 additions and 1 deletions

View File

@@ -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());
}
}