1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 09:01:15 +02:00

Don't call QuitAudacity directly from src/menus...

... This cuts link dependency on AudacityApp.cpp, and allows the function to
be private to that file
This commit is contained in:
Paul Licameli
2019-04-26 00:43:17 -04:00
parent 187e3be0d6
commit 6cde697a8e
6 changed files with 19 additions and 12 deletions

View File

@@ -542,7 +542,9 @@ void OnPrint(const CommandContext &context)
void OnExit(const CommandContext &WXUNUSED(context) )
{
QuitAudacity();
// Simulate the application Exit menu item
wxCommandEvent evt{ wxEVT_MENU, wxID_EXIT };
wxTheApp->AddPendingEvent( evt );
}
}; // struct Handler

View File

@@ -457,7 +457,11 @@ void OnTimerRecord(const CommandContext &context)
// No action required
break;
case POST_TIMER_RECORD_CLOSE:
wxTheApp->CallAfter( []{ QuitAudacity(); } );
wxTheApp->CallAfter( []{
// Simulate the application Exit menu item
wxCommandEvent evt{ wxEVT_MENU, wxID_EXIT };
wxTheApp->AddPendingEvent( evt );
} );
break;
case POST_TIMER_RECORD_RESTART:
// Restart System