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

@@ -15,14 +15,11 @@
#include "KeyboardCapture.h"
#include "ondemand/ODTaskThread.h"
#if defined(__WXMAC__)
#include "menus/WindowMenus.h"
#endif
#include <wx/display.h>
#include <wx/frame.h>
wxDEFINE_EVENT(EVT_TRACK_PANEL_TIMER, wxCommandEvent);
wxDEFINE_EVENT(EVT_PROJECT_ACTIVATION, wxCommandEvent);
size_t AllProjects::size() const
{
@@ -115,13 +112,9 @@ void SetActiveProject(AudacityProject * project)
if ( gActiveProject != project ) {
gActiveProject = project;
KeyboardCapture::Capture( nullptr );
wxTheApp->QueueEvent( safenew wxCommandEvent{ EVT_PROJECT_ACTIVATION } );
}
wxTheApp->SetTopWindow( FindProjectFrame( project ) );
#if defined(__WXMAC__)
// Refresh the Window menu
WindowActions::Refresh();
#endif
}
AudacityProject::AudacityProject()