Make sure Save As and Export use board footprint when selected.
Fixes: lp:1792207 * https://bugs.launchpad.net/kicad/+bug/1792207
This commit is contained in:
parent
23726116ee
commit
cbc83c98bc
|
@ -418,27 +418,33 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( SaveLibraryAs( Prj().PcbFootprintLibs()->FindRow( libName )->GetFullURI() ) )
|
||||
SyncLibraryTree( true );
|
||||
}
|
||||
else
|
||||
else if( getTargetFPId() == GetCurrentFPId() )
|
||||
{
|
||||
// Save Footprint As
|
||||
MODULE* footprint = LoadFootprint( getTargetFPId() );
|
||||
// Save Board Footprint As
|
||||
MODULE* footprint = GetBoard()->m_Modules;
|
||||
|
||||
if( footprint && SaveFootprintAs( footprint ) )
|
||||
{
|
||||
SyncLibraryTree( false );
|
||||
|
||||
if( getTargetFPId() == GetCurrentFPId() )
|
||||
{
|
||||
m_toolManager->GetView()->Update( GetBoard()->m_Modules );
|
||||
m_toolManager->GetView()->Update( GetBoard()->m_Modules );
|
||||
|
||||
if( IsGalCanvasActive() && GetGalCanvas() )
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
else
|
||||
GetCanvas()->Refresh();
|
||||
if( IsGalCanvasActive() && GetGalCanvas() )
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
else
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
GetScreen()->ClrModify();
|
||||
}
|
||||
GetScreen()->ClrModify();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save Selected Footprint As
|
||||
MODULE* footprint = LoadFootprint( getTargetFPId() );
|
||||
|
||||
if( footprint && SaveFootprintAs( footprint ) )
|
||||
SyncLibraryTree( false );
|
||||
}
|
||||
|
||||
m_treePane->GetLibTree()->Refresh();
|
||||
break;
|
||||
|
@ -465,7 +471,10 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_MODEDIT_EXPORT_PART:
|
||||
Export_Module( LoadFootprint( getTargetFPId() ) );
|
||||
if( getTargetFPId() == GetCurrentFPId() )
|
||||
Export_Module( GetBoard()->m_Modules ) )
|
||||
else
|
||||
Export_Module( LoadFootprint( getTargetFPId() ) );
|
||||
break;
|
||||
|
||||
case ID_MODEDIT_CREATE_NEW_LIB:
|
||||
|
|
|
@ -48,7 +48,7 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
|||
// Setup right click-context menus
|
||||
std::unique_ptr<wxMenu> menuLibrary = std::make_unique<wxMenu>();
|
||||
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_CREATE_NEW_LIB, _( "New &Library..." ),
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_CREATE_NEW_LIB, _( "&New Library..." ),
|
||||
KiBitmap( new_library_xpm ) );
|
||||
/* TODO
|
||||
AddMenuItem( menuLibrary.get(), ID_LIBEDIT_ADD_LIBRARY, _( "&Add Library..." ),
|
||||
|
@ -56,7 +56,7 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
|||
*/
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_SAVE, _( "&Save" ),
|
||||
KiBitmap( save_xpm ) );
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_SAVE_AS, _( "Save a Copy As..." ),
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_SAVE_AS, _( "Save a Copy &As..." ),
|
||||
KiBitmap( save_as_xpm ) );
|
||||
/* TODO
|
||||
AddMenuItem( menuLibrary.get(), ID_LIBEDIT_REVERT, _( "Revert" ),
|
||||
|
@ -64,7 +64,7 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
|||
*/
|
||||
|
||||
menuLibrary->AppendSeparator();
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_NEW_MODULE, _( "New &Footprint..." ),
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_NEW_MODULE, _( "&New Footprint..." ),
|
||||
KiBitmap( new_component_xpm ) );
|
||||
#ifdef KICAD_SCRIPTING
|
||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_NEW_MODULE_FROM_WIZARD,
|
||||
|
@ -81,9 +81,9 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
|||
menuPart->AppendSeparator();
|
||||
AddMenuItem( menuPart.get(), ID_MODEDIT_SAVE, _( "&Save" ),
|
||||
KiBitmap( save_xpm ) );
|
||||
AddMenuItem( menuPart.get(), ID_MODEDIT_SAVE_AS, _( "Save a Copy As..." ),
|
||||
AddMenuItem( menuPart.get(), ID_MODEDIT_SAVE_AS, _( "Save &As..." ),
|
||||
KiBitmap( save_xpm ) );
|
||||
AddMenuItem( menuPart.get(), ID_MODEDIT_DELETE_PART, _( "Delete" ),
|
||||
AddMenuItem( menuPart.get(), ID_MODEDIT_DELETE_PART, _( "&Delete" ),
|
||||
KiBitmap( delete_xpm ) );
|
||||
/* TODO
|
||||
AddMenuItem( menuPart.get(), ID_LIBEDIT_REVERT, _( "Revert" ),
|
||||
|
|
Loading…
Reference in New Issue