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:
parent
3ad5fd056e
commit
c0cd4c03fb
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue