Make sure UI gets adjusted for Symbol property changes.

For instance, if the number of units is changed from 1 to not-1
or vice versa then we need to rebuild the units selector.

Fixes https://gitlab.com/kicad/code/kicad/issues/4622
This commit is contained in:
Jeff Young 2020-07-16 01:08:31 +01:00
parent 20ca836ab3
commit e8079bf655
3 changed files with 8 additions and 16 deletions

View File

@ -341,10 +341,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow()
m_libEntry->SetFootprintFilters( m_FootprintFilterListBox->GetStrings() );
if( oldName != newName )
m_Parent->UpdateAfterSymbolProperties( &oldName );
else
m_Parent->RebuildView();
m_Parent->UpdateAfterSymbolProperties( &oldName );
// It's possible that the symbol being edited has no pins, in which case there may be no
// alternate body style objects causing #LIB_PART::HasCoversion() to always return false.

View File

@ -526,11 +526,13 @@ void LIB_EDIT_FRAME::UpdateAfterSymbolProperties( wxString* aOldName )
m_my_part->SetName( *aOldName );
}
else
{
m_libMgr->UpdatePartAfterRename( m_my_part, *aOldName, lib );
}
}
// Reselect the renamed part
m_treePane->GetLibTree()->SelectLibId( LIB_ID( lib, m_my_part->GetName() ) );
// Reselect the renamed part
m_treePane->GetLibTree()->SelectLibId( LIB_ID( lib, m_my_part->GetName() ) );
}
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurPart()->Flatten()->HasConversion() );

View File

@ -503,16 +503,9 @@ void LIB_EDIT_TOOL::editFieldProperties( LIB_FIELD* aField )
dlg.UpdateField( aField );
if( renamed )
{
parent->SetName( newFieldValue );
m_frame->UpdateAfterSymbolProperties( &oldFieldValue );
}
else
{
updateView( aField );
m_frame->GetCanvas()->Refresh();
m_frame->OnModify( );
}
m_frame->UpdateAfterSymbolProperties( &oldFieldValue );
}