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 245b778454
This commit is contained in:
parent
fc1f713106
commit
1ffcedd9d4
|
@ -619,6 +619,8 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxSize( 750, 600 ) );
|
wxSize( 750, 600 ) );
|
||||||
|
|
||||||
|
std::vector<wxString> messages;
|
||||||
|
|
||||||
int dup_error = 0;
|
int dup_error = 0;
|
||||||
|
|
||||||
for( unsigned ii = 1; ii < pinList.size(); ii++ )
|
for( unsigned ii = 1; ii < pinList.size(); ii++ )
|
||||||
|
@ -665,7 +667,7 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
|
||||||
|
|
||||||
msg += wxT( ".<br>" );
|
msg += wxT( ".<br>" );
|
||||||
|
|
||||||
error_display.m_htmlWindow->AppendToPage( msg );
|
messages.push_back( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for off grid pins:
|
// Test for off grid pins:
|
||||||
|
@ -705,11 +707,25 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
|
||||||
|
|
||||||
msg += wxT( ".<br>" );
|
msg += wxT( ".<br>" );
|
||||||
|
|
||||||
error_display.m_htmlWindow->AppendToPage( msg );
|
messages.push_back( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !dup_error && !offgrid_error )
|
if( !dup_error && !offgrid_error )
|
||||||
DisplayInfoMessage( this, _( "No off grid or duplicate pins were found." ) );
|
DisplayInfoMessage( this, _( "No off grid or duplicate pins were found." ) );
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
||||||
|
wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
|
||||||
|
wxString outmsg = wxString::Format( "<html><body bgcolor='%s' text='%s'>",
|
||||||
|
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||||
|
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ) );
|
||||||
|
|
||||||
|
for( auto& msg : messages )
|
||||||
|
outmsg += msg;
|
||||||
|
|
||||||
|
outmsg += "</body></html>";
|
||||||
|
|
||||||
|
error_display.m_htmlWindow->SetPage( outmsg );
|
||||||
error_display.ShowModal();
|
error_display.ShowModal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue