Resync lib_tree after editing aliases.
This also fixes an unrelated bug where the current part highlighting would get lost after a rename. Fixes: lp:1817639 * https://bugs.launchpad.net/kicad/+bug/1817639
This commit is contained in:
parent
c77031842e
commit
f494a24404
|
@ -356,9 +356,6 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow()
|
||||||
m_libEntry->GetFootprints().Clear();
|
m_libEntry->GetFootprints().Clear();
|
||||||
m_libEntry->GetFootprints() = m_FootprintFilterListBox->GetStrings();
|
m_libEntry->GetFootprints() = m_FootprintFilterListBox->GetStrings();
|
||||||
|
|
||||||
m_Parent->RebuildView();
|
|
||||||
m_Parent->OnModify();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1032,6 +1032,7 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
bool partLocked = GetCurPart()->UnitsLocked();
|
bool partLocked = GetCurPart()->UnitsLocked();
|
||||||
wxString oldName = GetCurPart()->GetName();
|
wxString oldName = GetCurPart()->GetName();
|
||||||
|
wxArrayString oldAliases = GetCurPart()->GetAliasNames( false );
|
||||||
|
|
||||||
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() );
|
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, GetGalCanvas()->GetDefaultCursor() );
|
||||||
|
|
||||||
|
@ -1062,8 +1063,13 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
|
||||||
if( oldName != GetCurPart()->GetName() )
|
if( oldName != GetCurPart()->GetName() )
|
||||||
m_libMgr->UpdatePartAfterRename( GetCurPart(), oldName, GetCurLib() );
|
m_libMgr->UpdatePartAfterRename( GetCurPart(), oldName, GetCurLib() );
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_libMgr->UpdatePart( GetCurPart(), GetCurLib() );
|
m_libMgr->UpdatePart( GetCurPart(), GetCurLib() );
|
||||||
|
|
||||||
|
if( oldAliases != GetCurPart()->GetAliasNames( false ) )
|
||||||
|
SyncLibraries( false );
|
||||||
|
}
|
||||||
|
|
||||||
UpdatePartSelectList();
|
UpdatePartSelectList();
|
||||||
updateTitle();
|
updateTitle();
|
||||||
DisplayCmpDoc();
|
DisplayCmpDoc();
|
||||||
|
@ -1638,6 +1644,13 @@ void LIB_EDIT_FRAME::SyncLibraries( bool aShowProgress )
|
||||||
if( found )
|
if( found )
|
||||||
m_treePane->GetLibTree()->SelectLibId( selected );
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -446,6 +446,7 @@ bool LIB_MANAGER::UpdatePartAfterRename( LIB_PART* aPart, const wxString& oldAli
|
||||||
wxCHECK( partBuf, false );
|
wxCHECK( partBuf, false );
|
||||||
partBuf->SetOriginal( original.release() ); // part buffer takes ownership of pointer
|
partBuf->SetOriginal( original.release() ); // part buffer takes ownership of pointer
|
||||||
|
|
||||||
|
SetCurrentPart( aPart->GetName() );
|
||||||
m_frame.SyncLibraries( false );
|
m_frame.SyncLibraries( false );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue