1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 09:01:15 +02:00

Do not require AudacityApp.h when using global file history

This commit is contained in:
Paul Licameli
2019-04-23 20:57:18 -04:00
parent d4f71c2c64
commit 2d8c287384
7 changed files with 51 additions and 40 deletions

View File

@@ -81,7 +81,7 @@ void DoExport
}
else
{
wxGetApp().AddFileToHistory(filename);
FileHistory::Global().AddFileToHistory(filename);
// We're in batch mode, the file does not exist already.
// We really can proceed without prompting.
int nChannels = MacroCommands::IsMono() ? 1 : 2;
@@ -131,7 +131,7 @@ AudacityProject *DoImportMIDI(
pProject->ZoomAfterImport(pTrack);
pNewProject = nullptr;
wxGetApp().AddFileToHistory(fileName);
FileHistory::Global().AddFileToHistory(fileName);
return pProject;
}
@@ -597,8 +597,9 @@ MenuTable::BaseItemPtr FileMenu( AudacityProject& )
,
Special( [](AudacityProject &, wxMenu &theMenu){
// Recent Files and Recent Projects menus
wxGetApp().GetRecentFiles()->UseMenu( &theMenu );
wxGetApp().GetRecentFiles()->AddFilesToMenu( &theMenu );
auto &history = FileHistory::Global();
history.UseMenu( &theMenu );
history.AddFilesToMenu( &theMenu );
wxWeakRef<wxMenu> recentFilesMenu{ &theMenu };
wxTheApp->CallAfter( [=] {