Context menu 'Delete All Well Paths'

p4#: 22354
This commit is contained in:
Magne Sjaastad
2013-09-08 12:11:22 +02:00
parent 7edac904d3
commit 3a77390b0a
4 changed files with 42 additions and 0 deletions

View File

@@ -220,6 +220,10 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
menu.addAction(QString("Add Script Path"), this, SLOT(slotAddScriptPath()));
menu.addAction(QString("Delete Script Path"), this, SLOT(slotDeleteScriptPath()));
}
else if (dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p()))
{
menu.addAction(QString("Delete All Well Paths"), this, SLOT(slotDeleteAllWellPaths()));
}
// Execute script on selection of cases
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
@@ -1639,3 +1643,16 @@ void RimUiTreeView::appendScriptItems(QMenu* menu, RimScriptCollection* scriptCo
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimUiTreeView::slotDeleteAllWellPaths()
{
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
if (myModel)
{
myModel->deleteAllWellPaths(currentIndex());
}
}