Stop reselecting on activation in plot view if a child is already selected

This commit is contained in:
Gaute Lindkvist
2019-10-18 09:58:13 +02:00
parent 3422f1b609
commit 0fd7f40e46

View File

@@ -644,9 +644,28 @@ void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
m_activePlotViewWindow = activatedView; m_activePlotViewWindow = activatedView;
if ( !blockSubWindowProjectTreeSelection() ) if ( !blockSubWindowProjectTreeSelection() )
{
std::vector<caf::PdmUiItem*> currentSelection;
m_projectTreeView->selectedUiItems( currentSelection );
bool childSelected = false;
for ( caf::PdmUiItem* uiItem : currentSelection )
{
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( uiItem );
if ( pdmObject )
{
RimViewWindow* owningView = nullptr;
pdmObject->firstAncestorOrThisOfType( owningView );
if ( owningView && owningView == activatedView )
{
childSelected = true;
}
}
}
if ( !childSelected )
{ {
selectAsCurrentItem( activatedView ); selectAsCurrentItem( activatedView );
} }
}
updateWellLogPlotToolBar(); updateWellLogPlotToolBar();
updateSummaryPlotToolBar(); updateSummaryPlotToolBar();