1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Enh 66 again: do not make duplicate About dialogs on Mac

This commit is contained in:
Paul Licameli
2016-06-20 19:12:03 -04:00
parent 41f9f506c0
commit 5e95491bfc
4 changed files with 31 additions and 14 deletions

View File

@@ -2030,21 +2030,19 @@ int AudacityApp::OnExit()
void AudacityApp::OnMenuAbout(wxCommandEvent & event)
{
// This function shadows a similar function
// in Menus.cpp, but should only be used on the Mac platform
// when no project windows are open. This check assures that
// this happens, and enable the same code to be present on
// all platforms.
if(gAudacityProjects.GetCount() == 0) {
// in Menus.cpp, but should only be used on the Mac platform.
#ifdef __WXMAC__
// Modeless dialog, consistent with other Mac applications
// Modeless dialog, consistent with other Mac applications
// Not more than one at once!
const auto instance = AboutDialog::ActiveIntance();
if (instance)
instance->Raise();
else
// This dialog deletes itself when dismissed
(safenew AboutDialog{ nullptr })->Show(true);
#else
AboutDialog dlog(NULL);
dlog.ShowModal();
wxASSERT(false);
#endif
}
else
event.Skip();
}
void AudacityApp::OnMenuNew(wxCommandEvent & event)