Only warn once in KillFocus for each error value in footprint name.
More than that just gets annoying, and there is at least one edge case which throws us into an infinite loop if we don't have something to break us out. Fixes: lp:1834966 * https://bugs.launchpad.net/kicad/+bug/1834966
This commit is contained in:
parent
faa730dfb1
commit
29db6152b3
|
@ -707,12 +707,19 @@ void DIALOG_FOOTPRINT_FP_EDITOR::OnFootprintNameText( wxCommandEvent& event )
|
||||||
|
|
||||||
void DIALOG_FOOTPRINT_FP_EDITOR::OnFootprintNameKillFocus( wxFocusEvent& event )
|
void DIALOG_FOOTPRINT_FP_EDITOR::OnFootprintNameKillFocus( wxFocusEvent& event )
|
||||||
{
|
{
|
||||||
if( !m_delayedFocusCtrl && !checkFootprintName( m_FootprintNameCtrl->GetValue() ) )
|
// Only warn once on KillFocus for each error value; after that it just gets annoying.
|
||||||
|
// This also fixes a bug where we endlessly cycle in some edge cases.
|
||||||
|
static wxString lastValue = wxEmptyString;
|
||||||
|
wxString valueNow = m_FootprintNameCtrl->GetValue();
|
||||||
|
|
||||||
|
if( !m_delayedFocusCtrl && valueNow != lastValue && !checkFootprintName( valueNow ) )
|
||||||
{
|
{
|
||||||
m_delayedFocusCtrl = m_FootprintNameCtrl;
|
m_delayedFocusCtrl = m_FootprintNameCtrl;
|
||||||
m_delayedFocusPage = 0;
|
m_delayedFocusPage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastValue = valueNow;
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue