| 1539 | using namespace MenuRegistry; |
| 1540 | |
| 1541 | auto PluginMenuItems() |
| 1542 | { |
| 1543 | static auto items = std::shared_ptr{ |
| 1544 | Items( "Macros", |
| 1545 | Section( "RepeatLast", |
| 1546 | // Delayed evaluation: |
| 1547 | [](AudacityProject &project) |
| 1548 | { |
| 1549 | const auto &lastTool = CommandManager::Get(project).mLastTool; |
| 1550 | TranslatableString buildMenuLabel; |
| 1551 | if (!lastTool.empty()) |
| 1552 | buildMenuLabel = |
| 1553 | XO("Repeat %s") |
| 1554 | .Format(PluginManager::Get().GetName(lastTool)); |
| 1555 | else |
| 1556 | buildMenuLabel = XO("Repeat Last Tool"); |
| 1557 | |
| 1558 | return Command( wxT("RepeatLastTool"), buildMenuLabel, |
| 1559 | OnRepeatLastTool, |
| 1560 | AudioIONotBusyFlag() | |
| 1561 | HasLastToolFlag(), |
| 1562 | Options{}.IsGlobal() ); |
| 1563 | } |
| 1564 | ), |
| 1565 | |
| 1566 | Command( wxT("ManageMacros"), XXO("&Macro Manager"), |
| 1567 | OnManageMacros, AudioIONotBusyFlag() ), |
| 1568 | |
| 1569 | Menu( wxT("Macros"), XXO("&Apply Macro"), |
| 1570 | // Palette has no access key to ensure first letter navigation of |
| 1571 | // sub menu |
| 1572 | Section( "", |
| 1573 | Command( wxT("ApplyMacrosPalette"), XXO("Palette..."), |
| 1574 | OnApplyMacrosPalette, AudioIONotBusyFlag() ) |
| 1575 | ), |
| 1576 | |
| 1577 | Section( "", |
| 1578 | // Delayed evaluation: |
| 1579 | [](AudacityProject&) { |
| 1580 | auto result = Items(""); |
| 1581 | PopulateMacrosMenu(*result, AudioIONotBusyFlag()); |
| 1582 | return result; |
| 1583 | } |
| 1584 | ) |
| 1585 | ) |
| 1586 | ) }; |
| 1587 | return items; |
| 1588 | } |
| 1589 | |
| 1590 | AttachedItem sAttachment1{ Indirect(PluginMenuItems()), wxT("Tools/Manage") }; |
| 1591 |
no test coverage detected