Unify menu item creation for closing a window
* Push a function into CONDITIONAL_MENU that adds the item * Modify the tooltip for close and exit items to have the program name Fixes: lp:1835454 * https://bugs.launchpad.net/kicad/+bug/1835454
This commit is contained in:
committed by
Jeff Young
parent
e47c9ccc0b
commit
8493daf9ff
@@ -99,17 +99,25 @@ void CONDITIONAL_MENU::AddSeparator( int aOrder )
|
||||
}
|
||||
|
||||
|
||||
void CONDITIONAL_MENU::AddQuitOrClose( KIFACE_I* aKiface )
|
||||
void CONDITIONAL_MENU::AddClose( wxString aAppname )
|
||||
{
|
||||
AddItem( wxID_CLOSE, _( "Close\tCTRL+W" ), wxString::Format( "Close %s", aAppname ), exit_xpm,
|
||||
SELECTION_CONDITIONS::ShowAlways );
|
||||
}
|
||||
|
||||
|
||||
void CONDITIONAL_MENU::AddQuitOrClose( KIFACE_I* aKiface, wxString aAppname )
|
||||
{
|
||||
if( !aKiface || aKiface->IsSingle() ) // not when under a project mgr
|
||||
{
|
||||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via
|
||||
// wxID_EXIT
|
||||
AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
AddItem( wxID_EXIT, _( "Quit" ), wxString::Format( "Quit %s", aAppname ), exit_xpm,
|
||||
SELECTION_CONDITIONS::ShowAlways );
|
||||
}
|
||||
else
|
||||
{
|
||||
AddItem( wxID_CLOSE, _( "Close\tCTRL+W" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
AddClose( aAppname );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user