Improved context menu for well collection and analysis model

This commit is contained in:
Magne Sjaastad 2013-10-24 11:06:26 +02:00
parent a74be74792
commit cd686990f0
3 changed files with 34 additions and 1 deletions

View File

@ -223,6 +223,14 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
else if (dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p()))
{
menu.addAction(QString("Delete All Well Paths"), this, SLOT(slotDeleteAllWellPaths()));
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
}
else if (dynamic_cast<RimAnalysisModels*>(uiItem->dataObject().p()))
{
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
}
// Execute script on selection of cases

View File

@ -1815,3 +1815,26 @@ void RiuMainWindow::slotOpenUsersGuideInBrowserAction()
errorHandler->showMessage("Failed open browser with the following url\n\n" + usersGuideUrl);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObject, QMenu* menu)
{
if (!menu)
{
return;
}
if (dynamic_cast<RimWellPathCollection*>(pdmObject))
{
menu->addAction(m_importWellPathsFromFileAction);
menu->addAction(m_importWellPathsFromSSIHubAction);
}
else if (dynamic_cast<RimAnalysisModels*>(pdmObject))
{
menu->addAction(m_importEclipseCaseAction);
menu->addAction(m_importInputEclipseFileAction);
menu->addAction(m_openMultipleEclipseCasesAction);
}
}

View File

@ -95,6 +95,9 @@ public:
void setDefaultWindowSize();
void appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObject, QMenu* menu);
protected:
virtual void closeEvent(QCloseEvent* event);
@ -275,7 +278,6 @@ private:
QAction* m_addWellCellsToRangeFilterAction;
void refreshDrawStyleActions();
std::vector<QPointer<QDockWidget> > additionalProjectTrees;
std::vector<QPointer<QDockWidget> > additionalPropertyEditors;
};