diff --git a/eeschema/dialogs/dialog_edit_component_in_lib.cpp b/eeschema/dialogs/dialog_edit_component_in_lib.cpp index 2909a329b2..e4e2557e69 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_lib.cpp @@ -356,9 +356,6 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow() m_libEntry->GetFootprints().Clear(); m_libEntry->GetFootprints() = m_FootprintFilterListBox->GetStrings(); - m_Parent->RebuildView(); - m_Parent->OnModify(); - return true; } diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index a1ad3d8636..9a81b354e1 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -1032,6 +1032,7 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event ) { bool partLocked = GetCurPart()->UnitsLocked(); wxString oldName = GetCurPart()->GetName(); + wxArrayString oldAliases = GetCurPart()->GetAliasNames( false ); m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() ); @@ -1062,8 +1063,13 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event ) if( oldName != GetCurPart()->GetName() ) m_libMgr->UpdatePartAfterRename( GetCurPart(), oldName, GetCurLib() ); else + { m_libMgr->UpdatePart( GetCurPart(), GetCurLib() ); + if( oldAliases != GetCurPart()->GetAliasNames( false ) ) + SyncLibraries( false ); + } + UpdatePartSelectList(); updateTitle(); DisplayCmpDoc(); @@ -1638,6 +1644,13 @@ void LIB_EDIT_FRAME::SyncLibraries( bool aShowProgress ) if( found ) m_treePane->GetLibTree()->SelectLibId( selected ); } + + // If no selection, see if there's a current part to centre + if( !selected.IsValid() && GetCurPart() ) + { + LIB_ID current( GetCurLib(), GetCurPart()->GetName() ); + m_treePane->GetLibTree()->CenterLibId( current ); + } } } diff --git a/eeschema/libedit/lib_manager.cpp b/eeschema/libedit/lib_manager.cpp index 1efe7a3a73..354fc52b6a 100644 --- a/eeschema/libedit/lib_manager.cpp +++ b/eeschema/libedit/lib_manager.cpp @@ -446,6 +446,7 @@ bool LIB_MANAGER::UpdatePartAfterRename( LIB_PART* aPart, const wxString& oldAli wxCHECK( partBuf, false ); partBuf->SetOriginal( original.release() ); // part buffer takes ownership of pointer + SetCurrentPart( aPart->GetName() ); m_frame.SyncLibraries( false ); return true;