mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
Stop reselecting on activation in plot view if a child is already selected
This commit is contained in:
parent
3422f1b609
commit
0fd7f40e46
@ -645,7 +645,26 @@ void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
||||
|
||||
if ( !blockSubWindowProjectTreeSelection() )
|
||||
{
|
||||
selectAsCurrentItem( activatedView );
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
updateWellLogPlotToolBar();
|
||||
|
Loading…
Reference in New Issue
Block a user