1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Bug1119: Windows menu on Mac should list all project names...

... Reimplemented without making dependency cycles.

Project and ProjectFileManager publish events for change of active project or
change of a project title.

WindowMenus.cpp can listen for those events, so that it can update the menu
appropriately.  So it's all done nonintrusively in the rest of the code.
This commit is contained in:
Paul Licameli
2020-04-21 13:07:01 -04:00
parent 78c2c09ba2
commit 2e3c072fd5
8 changed files with 106 additions and 154 deletions

View File

@@ -24,9 +24,7 @@ Paul Licameli split from AudacityProject.cpp
#include "widgets/AudacityMessageBox.h"
#include "widgets/NumericTextCtrl.h"
#if defined(__WXMAC__)
#include "menus/WindowMenus.h"
#endif
wxDEFINE_EVENT(EVT_PROJECT_TITLE_CHANGE, wxCommandEvent);
static void RefreshAllTitles(bool bShowProjectNumbers )
{
@@ -134,13 +132,13 @@ void ProjectFileIO::SetProjectTitle( int number)
name += _("(Recovered)");
}
window.SetTitle( name );
window.SetName(name); // to make the nvda screen reader read the correct title
if ( name != window.GetTitle() ) {
window.SetTitle( name );
window.SetName(name); // to make the nvda screen reader read the correct title
#if defined(__WXMAC__)
// Refresh the Window menu
WindowActions::Refresh();
#endif
project.QueueEvent(
safenew wxCommandEvent{ EVT_PROJECT_TITLE_CHANGE } );
}
}
// Most of this string was duplicated 3 places. Made the warning consistent in this global.