MCPcopy Create free account
hub / github.com/audacity/audacity / FileMenu

Function FileMenu

src/menus/FileMenus.cpp:457–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455using namespace MenuRegistry;
456
457auto FileMenu()
458{
459 static auto menu = std::shared_ptr{
460 Menu( wxT("File"), XXO("&File"),
461 Section( "Basic",
462 /*i18n-hint: "New" is an action (verb) to create a NEW project*/
463 Command( wxT("New"), XXO("&New"), OnNew,
464 AudioIONotBusyFlag(), wxT("Ctrl+N") ),
465
466 /*i18n-hint: (verb)*/
467 Command( wxT("Open"), XXO("&Open..."), OnOpen,
468 AudioIONotBusyFlag(), wxT("Ctrl+O") ),
469
470 #ifdef EXPERIMENTAL_RESET
471 // Empty the current project and forget its name and path. DANGEROUS
472 // It's just for developers.
473 // Do not translate this menu item (no XXO).
474 // It MUST not be shown to regular users.
475 Command( wxT("Reset"), XXO("&Dangerous Reset..."), OnProjectReset,
476 AudioIONotBusyFlag() ),
477 #endif
478
479 /////////////////////////////////////////////////////////////////////////////
480
481 Menu( wxT("Recent"),
482 #ifdef __WXMAC__
483 /* i18n-hint: This is the name of the menu item on Mac OS X only */
484 XXO("Open Recent")
485 #else
486 /* i18n-hint: This is the name of the menu item on Windows and Linux */
487 XXO("Recent &Files")
488 #endif
489 ,
490 MenuCreator::Special( wxT("PopulateRecentFilesStep"),
491 [](AudacityProject &, wxMenu &theMenu){
492 // Recent Files and Recent Projects menus
493 auto &history = FileHistory::Global();
494 history.UseMenu( &theMenu );
495
496 wxWeakRef<wxMenu> recentFilesMenu{ &theMenu };
497 wxTheApp->CallAfter( [=] {
498 // Bug 143 workaround.
499 // The bug is in wxWidgets. For a menu that has scrollers,
500 // the scrollers have an ID of 0 (not wxID_NONE which is -3).
501 // Therefore wxWidgets attempts to find a help string. See
502 // wxFrameBase::ShowMenuHelp(int menuId)
503 // It finds a bogus automatic help string of "Recent &Files"
504 // from that submenu.
505 // So we set the help string for command with Id 0 to empty.
506 if ( recentFilesMenu )
507 recentFilesMenu->GetParent()->SetHelpString( 0, "" );
508 } );
509 } )
510 )
511 ),
512
513 Section( "Save",
514 Menu( wxT("Save"), XXO("&Save Project"),

Callers 1

FileMenus.cppFile · 0.85

Calls 3

SectionClass · 0.85
UseMenuMethod · 0.80
GetParentMethod · 0.45

Tested by

no test coverage detected