From 1ffcedd9d4a16427277e22380dc92e510f05fbe2 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 28 Feb 2020 08:50:05 -0800 Subject: [PATCH] libedit: Fix speed of lib check The symbol check output the HTML message for each item. This is _very_ slow and can lock the system reponsiveness. Changing to a queue/flush method is much faster cherry-picked from 245b778454d7a457140c58d188a51c1d631b137d --- eeschema/libedit/pinedit.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/eeschema/libedit/pinedit.cpp b/eeschema/libedit/pinedit.cpp index 4f47c03ef7..b145e5fef6 100644 --- a/eeschema/libedit/pinedit.cpp +++ b/eeschema/libedit/pinedit.cpp @@ -619,6 +619,8 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event ) wxDefaultPosition, wxSize( 750, 600 ) ); + std::vector messages; + int dup_error = 0; for( unsigned ii = 1; ii < pinList.size(); ii++ ) @@ -665,7 +667,7 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event ) msg += wxT( ".
" ); - error_display.m_htmlWindow->AppendToPage( msg ); + messages.push_back( msg ); } // Test for off grid pins: @@ -705,11 +707,25 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event ) msg += wxT( ".
" ); - error_display.m_htmlWindow->AppendToPage( msg ); + messages.push_back( msg ); } if( !dup_error && !offgrid_error ) DisplayInfoMessage( this, _( "No off grid or duplicate pins were found." ) ); else + { + wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ); + wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); + wxString outmsg = wxString::Format( "", + bgcolor.GetAsString( wxC2S_HTML_SYNTAX ), + fgcolor.GetAsString( wxC2S_HTML_SYNTAX ) ); + + for( auto& msg : messages ) + outmsg += msg; + + outmsg += ""; + + error_display.m_htmlWindow->SetPage( outmsg ); error_display.ShowModal(); + } }