mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Introduce RimGridPlotWindow and RiuQwtPlotWidget
This commit is contained in:
@@ -206,6 +206,35 @@ void RiuMainWindowBase::selectAsCurrentItem( const caf::PdmObject* object, bool
|
||||
m_allowActiveViewChangeFromSelection = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::toggleItemInSelection( const caf::PdmObject* object, bool allowActiveViewChange )
|
||||
{
|
||||
m_allowActiveViewChangeFromSelection = allowActiveViewChange;
|
||||
std::vector<caf::PdmUiItem*> currentSelection;
|
||||
m_projectTreeView->selectedUiItems( currentSelection );
|
||||
std::vector<const caf::PdmUiItem*> updatedSelection;
|
||||
bool alreadySelected = false;
|
||||
for ( caf::PdmUiItem* uiItem : currentSelection )
|
||||
{
|
||||
if ( object == uiItem )
|
||||
{
|
||||
alreadySelected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
updatedSelection.push_back( uiItem );
|
||||
}
|
||||
}
|
||||
if ( !alreadySelected )
|
||||
{
|
||||
updatedSelection.push_back( object );
|
||||
}
|
||||
m_projectTreeView->selectItems( updatedSelection );
|
||||
m_allowActiveViewChangeFromSelection = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user