diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index c206c807dd..809e5eb5b3 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -253,6 +253,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_canvas->SetEnableBlockCommands( true ); m_libMgr = new LIB_MANAGER( *this ); + SyncLibraries(); m_treePane = new CMP_TREE_PANE( this, m_libMgr ); ReCreateMenuBar(); @@ -485,7 +486,6 @@ void LIB_EDIT_FRAME::OnEditSymbolLibTable( wxCommandEvent& aEvent ) { SCH_BASE_FRAME::OnEditSymbolLibTable( aEvent ); SyncLibraries(); - m_treePane->Refresh(); } @@ -1616,14 +1616,21 @@ wxString LIB_EDIT_FRAME::getTargetLib() const void LIB_EDIT_FRAME::SyncLibraries() { + auto tree = m_treePane ? m_treePane->GetCmpTree() : nullptr; wxBusyCursor cursor; + if( tree ) + tree->Freeze(); + wxProgressDialog progressDlg( _( "Loading symbol libraries" ), wxEmptyString, m_libMgr->GetAdapter()->GetLibrariesCount(), this ); m_libMgr->Sync( true, [&]( int progress, int max, const wxString& libName ) { progressDlg.Update( progress, wxString::Format( _( "Loading library '%s'" ), libName ) ); } ); + + if( tree ) + tree->Thaw(); } diff --git a/eeschema/widgets/cmp_tree_pane.cpp b/eeschema/widgets/cmp_tree_pane.cpp index 0147fb5930..915aefaf67 100644 --- a/eeschema/widgets/cmp_tree_pane.cpp +++ b/eeschema/widgets/cmp_tree_pane.cpp @@ -38,7 +38,6 @@ CMP_TREE_PANE::CMP_TREE_PANE( LIB_EDIT_FRAME* aParent, LIB_MANAGER* aLibMgr ) // Create widgets wxBoxSizer* boxSizer = new wxBoxSizer( wxVERTICAL ); - m_libEditFrame->SyncLibraries(); m_tree = new COMPONENT_TREE( this, &SYMBOL_LIB_TABLE::GetGlobalLibTable(), m_libMgr->GetAdapter(), COMPONENT_TREE::SEARCH );