commit/groups: add ability to modify membership of group

Also add warning when you've tried to modify two groups in one commit,
which isn't currently supported.
This commit is contained in:
Mike Williams 2025-05-14 12:14:43 -04:00
parent eff4cdd6b4
commit 195e79ae46
2 changed files with 18 additions and 0 deletions

View File

@ -283,7 +283,10 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
}
if( schItem->Type() == SCH_GROUP_T )
{
wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." );
addedGroup = static_cast<SCH_GROUP*>( schItem );
}
if( frame )
frame->UpdateItem( schItem, true, true );
@ -374,6 +377,12 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
ent.m_copy = nullptr; // We've transferred ownership to the undo list
}
if( schItem->Type() == SCH_GROUP_T )
{
wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." );
addedGroup = static_cast<SCH_GROUP*>( schItem );
}
if( frame )
frame->UpdateItem( schItem, false, true );

View File

@ -320,7 +320,10 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
}
if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T )
{
wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." );
addedGroup = static_cast<PCB_GROUP*>( boardItem );
}
if( boardItem->Type() != PCB_MARKER_T )
propagateDamage( boardItem, staleZones );
@ -467,6 +470,12 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
connectivity->Update( boardItem );
}
if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T )
{
wxASSERT_MSG( !addedGroup, "Multiple groups in a single commit. This is not supported." );
addedGroup = static_cast<PCB_GROUP*>( boardItem );
}
if( boardItem->Type() != PCB_MARKER_T )
{
propagateDamage( boardItemCopy, staleZones ); // before