Footprints in the footprint editor can't be in a group.

This commit is contained in:
Jeff Young 2022-11-12 13:39:21 +00:00
parent 6a9a1e6e65
commit 365674dfdf
4 changed files with 7 additions and 5 deletions

View File

@ -334,7 +334,8 @@ FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME()
bool FOOTPRINT_EDIT_FRAME::IsContentModified() const
{
return GetScreen() && GetScreen()->IsContentModified() && GetBoard() && GetBoard()->GetFirstFootprint();
return GetScreen() && GetScreen()->IsContentModified()
&& GetBoard() && GetBoard()->GetFirstFootprint();
}
@ -505,7 +506,7 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
void FOOTPRINT_EDIT_FRAME::AddFootprintToBoard( FOOTPRINT* aFootprint )
{
m_revertModule.reset( (FOOTPRINT*) aFootprint->Clone() );
m_originalFootprintCopy.reset( static_cast<FOOTPRINT*>( aFootprint->Clone() ) );
m_footprintNameWhenLoaded = aFootprint->GetFPID().GetLibItemName();

View File

@ -362,7 +362,7 @@ private:
bool m_show_layer_manager_tools;
std::unique_ptr<FOOTPRINT> m_revertModule;
std::unique_ptr<FOOTPRINT> m_originalFootprintCopy;
wxString m_footprintNameWhenLoaded;
std::map<KIID, KIID> m_boardFootprintUuids;
};

View File

@ -1200,7 +1200,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintAs( FOOTPRINT* aFootprint )
bool FOOTPRINT_EDIT_FRAME::RevertFootprint()
{
if( GetScreen()->IsContentModified() && m_revertModule )
if( GetScreen()->IsContentModified() && m_originalFootprintCopy )
{
wxString msg = wxString::Format( _( "Revert '%s' to last version saved?" ),
GetLoadedFPID().GetLibItemName().wx_str() );
@ -1208,7 +1208,7 @@ bool FOOTPRINT_EDIT_FRAME::RevertFootprint()
if( ConfirmRevertDialog( this, msg ) )
{
Clear_Pcb( false );
AddFootprintToBoard( static_cast<FOOTPRINT*>( m_revertModule->Clone() ) );
AddFootprintToBoard( static_cast<FOOTPRINT*>( m_originalFootprintCopy->Clone() ) );
Zoom_Automatique( false );

View File

@ -118,6 +118,7 @@ bool FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard( FOOTPRINT* aFootprint )
newFootprint = (FOOTPRINT*) aFootprint->Clone(); // Keep existing uuids
newFootprint->SetParent( GetBoard() );
newFootprint->SetParentGroup( nullptr );
newFootprint->SetLink( aFootprint->m_Uuid );
newFootprint->ClearFlags();