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() ) )
|
if( SaveLibraryAs( Prj().PcbFootprintLibs()->FindRow( libName )->GetFullURI() ) )
|
||||||
SyncLibraryTree( true );
|
SyncLibraryTree( true );
|
||||||
}
|
}
|
||||||
else
|
else if( getTargetFPId() == GetCurrentFPId() )
|
||||||
{
|
{
|
||||||
// Save Footprint As
|
// Save Board Footprint As
|
||||||
MODULE* footprint = LoadFootprint( getTargetFPId() );
|
MODULE* footprint = GetBoard()->m_Modules;
|
||||||
|
|
||||||
if( footprint && SaveFootprintAs( footprint ) )
|
if( footprint && SaveFootprintAs( footprint ) )
|
||||||
{
|
{
|
||||||
SyncLibraryTree( false );
|
SyncLibraryTree( false );
|
||||||
|
|
||||||
if( getTargetFPId() == GetCurrentFPId() )
|
m_toolManager->GetView()->Update( GetBoard()->m_Modules );
|
||||||
{
|
|
||||||
m_toolManager->GetView()->Update( GetBoard()->m_Modules );
|
|
||||||
|
|
||||||
if( IsGalCanvasActive() && GetGalCanvas() )
|
if( IsGalCanvasActive() && GetGalCanvas() )
|
||||||
GetGalCanvas()->ForceRefresh();
|
GetGalCanvas()->ForceRefresh();
|
||||||
else
|
else
|
||||||
GetCanvas()->Refresh();
|
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();
|
m_treePane->GetLibTree()->Refresh();
|
||||||
break;
|
break;
|
||||||
|
@ -465,7 +471,10 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MODEDIT_EXPORT_PART:
|
case ID_MODEDIT_EXPORT_PART:
|
||||||
Export_Module( LoadFootprint( getTargetFPId() ) );
|
if( getTargetFPId() == GetCurrentFPId() )
|
||||||
|
Export_Module( GetBoard()->m_Modules ) )
|
||||||
|
else
|
||||||
|
Export_Module( LoadFootprint( getTargetFPId() ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MODEDIT_CREATE_NEW_LIB:
|
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
|
// Setup right click-context menus
|
||||||
std::unique_ptr<wxMenu> menuLibrary = std::make_unique<wxMenu>();
|
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 ) );
|
KiBitmap( new_library_xpm ) );
|
||||||
/* TODO
|
/* TODO
|
||||||
AddMenuItem( menuLibrary.get(), ID_LIBEDIT_ADD_LIBRARY, _( "&Add Library..." ),
|
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" ),
|
AddMenuItem( menuLibrary.get(), ID_MODEDIT_SAVE, _( "&Save" ),
|
||||||
KiBitmap( save_xpm ) );
|
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 ) );
|
KiBitmap( save_as_xpm ) );
|
||||||
/* TODO
|
/* TODO
|
||||||
AddMenuItem( menuLibrary.get(), ID_LIBEDIT_REVERT, _( "Revert" ),
|
AddMenuItem( menuLibrary.get(), ID_LIBEDIT_REVERT, _( "Revert" ),
|
||||||
|
@ -64,7 +64,7 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent )
|
||||||
*/
|
*/
|
||||||
|
|
||||||
menuLibrary->AppendSeparator();
|
menuLibrary->AppendSeparator();
|
||||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_NEW_MODULE, _( "New &Footprint..." ),
|
AddMenuItem( menuLibrary.get(), ID_MODEDIT_NEW_MODULE, _( "&New Footprint..." ),
|
||||||
KiBitmap( new_component_xpm ) );
|
KiBitmap( new_component_xpm ) );
|
||||||
#ifdef KICAD_SCRIPTING
|
#ifdef KICAD_SCRIPTING
|
||||||
AddMenuItem( menuLibrary.get(), ID_MODEDIT_NEW_MODULE_FROM_WIZARD,
|
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();
|
menuPart->AppendSeparator();
|
||||||
AddMenuItem( menuPart.get(), ID_MODEDIT_SAVE, _( "&Save" ),
|
AddMenuItem( menuPart.get(), ID_MODEDIT_SAVE, _( "&Save" ),
|
||||||
KiBitmap( save_xpm ) );
|
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 ) );
|
KiBitmap( save_xpm ) );
|
||||||
AddMenuItem( menuPart.get(), ID_MODEDIT_DELETE_PART, _( "Delete" ),
|
AddMenuItem( menuPart.get(), ID_MODEDIT_DELETE_PART, _( "&Delete" ),
|
||||||
KiBitmap( delete_xpm ) );
|
KiBitmap( delete_xpm ) );
|
||||||
/* TODO
|
/* TODO
|
||||||
AddMenuItem( menuPart.get(), ID_LIBEDIT_REVERT, _( "Revert" ),
|
AddMenuItem( menuPart.get(), ID_LIBEDIT_REVERT, _( "Revert" ),
|
||||||
|
|
|
@ -70,12 +70,12 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
||||||
text, _( "Create a new footprint" ),
|
text, _( "Create a new footprint" ),
|
||||||
KiBitmap( new_footprint_xpm ) );
|
KiBitmap( new_footprint_xpm ) );
|
||||||
|
|
||||||
#ifdef KICAD_SCRIPTING
|
#ifdef KICAD_SCRIPTING
|
||||||
AddMenuItem( fileMenu, ID_MODEDIT_NEW_MODULE_FROM_WIZARD,
|
AddMenuItem( fileMenu, ID_MODEDIT_NEW_MODULE_FROM_WIZARD,
|
||||||
_( "&Create Footprint..." ),
|
_( "&Create Footprint..." ),
|
||||||
_( "Create a new footprint using the footprint wizard" ),
|
_( "Create a new footprint using the footprint wizard" ),
|
||||||
KiBitmap( module_wizard_xpm ) );
|
KiBitmap( module_wizard_xpm ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue