pcbnew: Handle cancel action in fp load

When the user cancels the footprint load, we should assume they are
canceling the placement of a new footprint.  This also adds sanity check
when populating the list

Fixes: lp:1814181
* https://bugs.launchpad.net/kicad/+bug/1814181
This commit is contained in:
Seth Hillbrand 2019-02-01 15:47:03 +01:00
parent 3ad5fd056e
commit c0cd4c03fb
2 changed files with 7 additions and 1 deletions

View File

@ -113,7 +113,10 @@ void LIB_TREE_MODEL_ADAPTER::DoAddLibrary( wxString const& aNodeName, wxString c
auto& lib_node = m_tree.AddLib( aNodeName, aDesc );
for( auto item: aItemList )
lib_node.AddItem( item );
{
if( item )
lib_node.AddItem( item );
}
lib_node.AssignIntrinsicRanks( presorted );
}

View File

@ -215,6 +215,9 @@ MODULE* PCB_BASE_FRAME::SelectFootprintFromLibTree( LIB_ID aPreselect, bool aAll
GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter );
progressReporter.Show( false );
if( progressReporter.WasCancelled() )
return NULL;
if( GFootprintList.GetErrorCount() )
GFootprintList.DisplayErrors( this );