diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index 1bb6c44568..588b823e44 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -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: diff --git a/pcbnew/footprint_tree_pane.cpp b/pcbnew/footprint_tree_pane.cpp index 43ec13bb77..b082ace66d 100644 --- a/pcbnew/footprint_tree_pane.cpp +++ b/pcbnew/footprint_tree_pane.cpp @@ -48,7 +48,7 @@ FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE( FOOTPRINT_EDIT_FRAME* aParent ) // Setup right click-context menus std::unique_ptr menuLibrary = std::make_unique(); - 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" ), diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index 01528115ed..bf26bf547c 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -70,12 +70,12 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() text, _( "Create a new footprint" ), KiBitmap( new_footprint_xpm ) ); -#ifdef KICAD_SCRIPTING +#ifdef KICAD_SCRIPTING AddMenuItem( fileMenu, ID_MODEDIT_NEW_MODULE_FROM_WIZARD, _( "&Create Footprint..." ), _( "Create a new footprint using the footprint wizard" ), KiBitmap( module_wizard_xpm ) ); -#endif +#endif fileMenu->AppendSeparator();