1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

ViewMenus not link dependent on ToolbarMenus

This commit is contained in:
Paul Licameli 2020-01-29 14:45:49 -05:00
parent ffe101f9a2
commit 1061c98b9f
2 changed files with 76 additions and 79 deletions

View File

@ -253,93 +253,98 @@ static CommandHandlerObject &findCommandHandler(AudacityProject &) {
#define FN(X) (& ToolbarActions::Handler :: X)
// Under /MenuBar/View
MenuTable::BaseItemSharedPtr ToolbarsMenu()
namespace{
using namespace MenuTable;
BaseItemSharedPtr ToolbarsMenu()
{
using namespace MenuTable;
using Options = CommandManager::Options;
static const auto checkOff = Options{}.CheckState( false );
static BaseItemSharedPtr menu{
( FinderScope{ findCommandHandler },
Menu( wxT("Toolbars"), XO("&Toolbars"),
Section( "Reset",
/* i18n-hint: (verb)*/
Command( wxT("ResetToolbars"), XXO("Reset Toolb&ars"),
FN(OnResetToolBars), AlwaysEnabledFlag )
),
Section( wxT("Toolbars"),
Menu( wxT("Toolbars"), XO("&Toolbars"),
Section( "Reset",
/* i18n-hint: (verb)*/
Command( wxT("ResetToolbars"), XXO("Reset Toolb&ars"),
FN(OnResetToolBars), AlwaysEnabledFlag )
),
Section( "Other",
/* i18n-hint: Clicking this menu item shows the toolbar
with the big buttons on it (play record etc)*/
Command( wxT("ShowTransportTB"), XXO("&Transport Toolbar"),
FN(OnShowTransportToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows a toolbar
that has some tools in it*/
Command( wxT("ShowToolsTB"), XXO("T&ools Toolbar"),
FN(OnShowToolsToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
with the recording level meters*/
Command( wxT("ShowRecordMeterTB"), XXO("&Recording Meter Toolbar"),
FN(OnShowRecordMeterToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
with the playback level meter*/
Command( wxT("ShowPlayMeterTB"), XXO("&Playback Meter Toolbar"),
FN(OnShowPlayMeterToolBar), AlwaysEnabledFlag, checkOff )
Section( "Other",
/* i18n-hint: Clicking this menu item shows the toolbar
with the big buttons on it (play record etc)*/
Command( wxT("ShowTransportTB"), XXO("&Transport Toolbar"),
FN(OnShowTransportToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows a toolbar
that has some tools in it*/
Command( wxT("ShowToolsTB"), XXO("T&ools Toolbar"),
FN(OnShowToolsToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
with the recording level meters*/
Command( wxT("ShowRecordMeterTB"), XXO("&Recording Meter Toolbar"),
FN(OnShowRecordMeterToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
with the playback level meter*/
Command( wxT("ShowPlayMeterTB"), XXO("&Playback Meter Toolbar"),
FN(OnShowPlayMeterToolBar), AlwaysEnabledFlag, checkOff )
/* --i18nhint: Clicking this menu item shows the toolbar
which has sound level meters*/
//Command( wxT("ShowMeterTB"), XXO("Co&mbined Meter Toolbar"),
// FN(OnShowMeterToolBar), AlwaysEnabledFlag, checkOff ),
/* --i18nhint: Clicking this menu item shows the toolbar
which has sound level meters*/
//Command( wxT("ShowMeterTB"), XXO("Co&mbined Meter Toolbar"),
// FN(OnShowMeterToolBar), AlwaysEnabledFlag, checkOff ),
,
/* i18n-hint: Clicking this menu item shows the toolbar
with the mixer*/
Command( wxT("ShowMixerTB"), XXO("Mi&xer Toolbar"),
FN(OnShowMixerToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar for editing*/
Command( wxT("ShowEditTB"), XXO("&Edit Toolbar"),
FN(OnShowEditToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
for transcription (currently just vary play speed)*/
Command( wxT("ShowTranscriptionTB"), XXO("Pla&y-at-Speed Toolbar"),
FN(OnShowTranscriptionToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
that enables Scrub or Seek playback and Scrub Ruler*/
Command( wxT("ShowScrubbingTB"), XXO("Scru&b Toolbar"),
FN(OnShowScrubbingToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
that manages devices*/
Command( wxT("ShowDeviceTB"), XXO("&Device Toolbar"),
FN(OnShowDeviceToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
for selecting a time range of audio*/
Command( wxT("ShowSelectionTB"), XXO("&Selection Toolbar"),
FN(OnShowSelectionToolBar), AlwaysEnabledFlag, checkOff )
#ifdef EXPERIMENTAL_TIMER_TOOLBAR
,
/* i18n-hint: Clicking this menu item shows the toolbar
with the mixer*/
Command( wxT("ShowMixerTB"), XXO("Mi&xer Toolbar"),
FN(OnShowMixerToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar for editing*/
Command( wxT("ShowEditTB"), XXO("&Edit Toolbar"),
FN(OnShowEditToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
for transcription (currently just vary play speed)*/
Command( wxT("ShowTranscriptionTB"), XXO("Pla&y-at-Speed Toolbar"),
FN(OnShowTranscriptionToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
that enables Scrub or Seek playback and Scrub Ruler*/
Command( wxT("ShowScrubbingTB"), XXO("Scru&b Toolbar"),
FN(OnShowScrubbingToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
that manages devices*/
Command( wxT("ShowDeviceTB"), XXO("&Device Toolbar"),
FN(OnShowDeviceToolBar), AlwaysEnabledFlag, checkOff ),
/* i18n-hint: Clicking this menu item shows the toolbar
for selecting a time range of audio*/
Command( wxT("ShowSelectionTB"), XXO("&Selection Toolbar"),
FN(OnShowSelectionToolBar), AlwaysEnabledFlag, checkOff )
#ifdef EXPERIMENTAL_TIMER_TOOLBAR
,
/* i18n-hint: Clicking this menu item shows the toolbar
for viewing actual time of the cursor*/
Command( wxT("ShowTimerToolBarTB"), XXO("&Timer Toolbar"),
FN(OnShowTimerToolBar), AlwaysEnabledFlag, checkOff )
#endif
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
,
Command( wxT("ShowSpectralSelectionTB"),
/* i18n-hint: Clicking this menu item shows the toolbar
for selecting a frequency range of audio*/
XXO("Spe&ctral Selection Toolbar"),
FN(OnShowSpectralSelectionToolBar), AlwaysEnabledFlag, checkOff )
#endif
/* i18n-hint: Clicking this menu item shows the toolbar
for viewing actual time of the cursor*/
Command( wxT("ShowTimerToolBarTB"), XXO("&Timer Toolbar"),
FN(OnShowTimerToolBar), AlwaysEnabledFlag, checkOff )
#endif
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
,
Command( wxT("ShowSpectralSelectionTB"),
/* i18n-hint: Clicking this menu item shows the toolbar
for selecting a frequency range of audio*/
XXO("Spe&ctral Selection Toolbar"),
FN(OnShowSpectralSelectionToolBar), AlwaysEnabledFlag, checkOff )
#endif
)
)
) ) };
return menu;
}
namespace {
using namespace MenuTable;
AttachedItem sAttachment1{
Placement{ wxT("View/Other"), { OrderingHint::Begin } },
Shared( ToolbarsMenu() )
};
BaseItemSharedPtr ExtraToolsMenu()
{
static BaseItemSharedPtr menu{

View File

@ -382,8 +382,6 @@ static CommandHandlerObject &findCommandHandler(AudacityProject &project) {
#define FN(X) (& ViewActions::Handler :: X)
MenuTable::BaseItemSharedPtr ToolbarsMenu();
// Under /MenuBar
namespace {
using namespace MenuTable;
@ -440,12 +438,6 @@ BaseItemSharedPtr ViewMenu()
Section( "Windows" ),
Section( "",
//////////////////////////////////////////////////////////////////////////
ToolbarsMenu()
),
Section( "Other",
Command( wxT("ShowExtraMenus"), XXO("&Extra Menus (on/off)"),
FN(OnShowExtraMenus), AlwaysEnabledFlag,