mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-29 00:30:23 +01:00
Bug1511: REBUILD WXWIDGETS: Mac Quit via tooldock doesn't crash...
... in case at least three projects are open, or skip save prompts either, in case at least two projects with unsaved changes are open.
This commit is contained in:
@@ -744,7 +744,8 @@ void AudacityApp::MacNewFile()
|
||||
#define kAudacityAppTimerID 0
|
||||
|
||||
BEGIN_EVENT_TABLE(AudacityApp, wxApp)
|
||||
EVT_QUERY_END_SESSION(AudacityApp::OnEndSession)
|
||||
EVT_QUERY_END_SESSION(AudacityApp::OnQueryEndSession)
|
||||
EVT_END_SESSION(AudacityApp::OnEndSession)
|
||||
|
||||
EVT_TIMER(kAudacityAppTimerID, AudacityApp::OnTimer)
|
||||
#ifdef __WXMAC__
|
||||
@@ -1974,6 +1975,20 @@ void AudacityApp::FindFilesInPathList(const wxString & pattern,
|
||||
}
|
||||
}
|
||||
|
||||
void AudacityApp::OnQueryEndSession(wxCloseEvent & event)
|
||||
{
|
||||
bool mustVeto = false;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
mustVeto = wxDialog::OSXHasModalDialogsOpen();
|
||||
#endif
|
||||
|
||||
if ( mustVeto )
|
||||
event.Veto(true);
|
||||
else
|
||||
OnEndSession(event);
|
||||
}
|
||||
|
||||
void AudacityApp::OnEndSession(wxCloseEvent & event)
|
||||
{
|
||||
bool force = !event.CanVeto();
|
||||
|
||||
@@ -205,6 +205,7 @@ class AudacityApp final : public wxApp {
|
||||
void OnMenuPreferences(wxCommandEvent & event);
|
||||
void OnMenuExit(wxCommandEvent & event);
|
||||
|
||||
void OnQueryEndSession(wxCloseEvent & event);
|
||||
void OnEndSession(wxCloseEvent & event);
|
||||
|
||||
// Most Recently Used File support (for all platforms).
|
||||
|
||||
Reference in New Issue
Block a user