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

Revert changes for Bug 1119 made by Paul.

These changes were made too close to release and are considered too dangerous for 2.4.0.
We will use the changes Leland provided.  We can review these proposed changes by Paul after 2.4.0 is released.
This commit is contained in:
James Crook
2020-04-21 17:45:16 +01:00
parent c3d0d0370b
commit 018a8681ef
8 changed files with 152 additions and 106 deletions

View File

@@ -109,6 +109,10 @@ It handles initialization and termination by subclassing wxApp.
#include "tracks/ui/Scrubbing.h"
#include "widgets/FileHistory.h"
#if defined(__WXMAC__)
#include "menus/WindowMenus.h"
#endif
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
#include "prefs/KeyConfigPrefs.h"
#endif
@@ -885,6 +889,11 @@ BEGIN_EVENT_TABLE(AudacityApp, wxApp)
EVT_MENU_RANGE(FileHistory::ID_RECENT_FIRST, FileHistory::ID_RECENT_LAST,
AudacityApp::OnMRUFile)
#if defined(__WXMAC__)
// Window menu event handlers.
EVT_MENU_RANGE(WindowActions::ID_BASE, WindowActions::ID_LAST, AudacityApp::OnWindow)
#endif
// Handle AppCommandEvents (usually from a script)
EVT_APP_COMMAND(wxID_ANY, AudacityApp::OnReceiveCommand)
@@ -978,6 +987,35 @@ void AudacityApp::OnMRUFile(wxCommandEvent& event) {
history.RemoveFileFromHistory(n);
}
#if defined(__WXMAC__)
// Handles switching projects when an item in the Window menu is selected
void AudacityApp::OnWindow(wxCommandEvent& event)
{
// Get the project's number
int projectNumber = event.GetId() - WindowActions::ID_BASE;
// Search for it
for (auto project : AllProjects{})
{
if (project->GetProjectNumber() == projectNumber)
{
// Make it the active project
SetActiveProject(project.get());
// And ensure it's visible
wxFrame *frame = project->GetFrame();
if (frame->IsIconized())
{
frame->Restore();
}
frame->Raise();
break;
}
}
}
#endif
void AudacityApp::OnTimer(wxTimerEvent& WXUNUSED(event))
{
// Filenames are queued when Audacity receives a few of the