Make Footprint Editor save command context-sensitive.
Fixes: lp:1795961 * https://bugs.launchpad.net/kicad/+bug/1795961
This commit is contained in:
parent
52246121b9
commit
ca25f352ce
|
@ -637,6 +637,13 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateModuleTargeted( wxUpdateUIEvent& aEvent )
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
if( aEvent.GetId() == ID_MODEDIT_SAVE )
|
||||
{
|
||||
wxString text = IsCurrentFPFromBoard() ? _( "&Update Footprint on Board" ) : _( "&Save" );
|
||||
text = AddHotkeyName( text, m_hotkeysDescrList, HK_SAVE );
|
||||
aEvent.SetText( text );
|
||||
}
|
||||
|
||||
aEvent.Enable( GetBoard()->m_Modules && GetScreen()->IsModify() );
|
||||
}
|
||||
|
||||
|
|
|
@ -63,11 +63,18 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
|
|||
_( "New footprint using footprint wizard" ) );
|
||||
#endif
|
||||
|
||||
if( IsCurrentFPFromBoard() )
|
||||
{
|
||||
m_mainToolBar->AddTool( ID_MODEDIT_SAVE, wxEmptyString,
|
||||
KiScaledBitmap( IsCurrentFPFromBoard() ? save_fp_to_board_xpm : save_xpm,
|
||||
this ),
|
||||
IsCurrentFPFromBoard() ?
|
||||
_( "Save changes to board" ) : _( "Save changes to library" ) );
|
||||
KiScaledBitmap( save_fp_to_board_xpm, this ),
|
||||
_( "Update footprint on board" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mainToolBar->AddTool( ID_MODEDIT_SAVE, wxEmptyString,
|
||||
KiScaledBitmap( save_xpm, this ),
|
||||
_( "Save changes to library" ) );
|
||||
}
|
||||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString,
|
||||
|
|
Loading…
Reference in New Issue