From eb1104445cec364adf58c841fc416c449ef01cdb Mon Sep 17 00:00:00 2001 From: David Bailes Date: Mon, 9 Nov 2020 10:10:22 +0000 Subject: [PATCH] Bug 2580: move to label commands in unexpected menu Fix: In the Extra menu, move the move to label commands from the play-at-speed sub menu to the selection sub menu. --- src/menus/TransportMenus.cpp | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/menus/TransportMenus.cpp b/src/menus/TransportMenus.cpp index f337f3a15..0493c8cf0 100644 --- a/src/menus/TransportMenus.cpp +++ b/src/menus/TransportMenus.cpp @@ -1253,17 +1253,7 @@ BaseItemSharedPtr ExtraPlayAtSpeedMenu() Command( wxT("PlaySpeedInc"), XXO("&Increase Playback Speed"), FN(OnPlaySpeedInc), CaptureNotBusyFlag() ), Command( wxT("PlaySpeedDec"), XXO("&Decrease Playback Speed"), - FN(OnPlaySpeedDec), CaptureNotBusyFlag() ), - - // These were on the original transcription toolbar. - // But they are not on the - // shortened one. - Command( wxT("MoveToPrevLabel"), XXO("Move to &Previous Label"), - FN(OnMoveToPrevLabel), - CaptureNotBusyFlag() | TrackPanelHasFocus(), wxT("Alt+Left") ), - Command( wxT("MoveToNextLabel"), XXO("Move to &Next Label"), - FN(OnMoveToNextLabel), - CaptureNotBusyFlag() | TrackPanelHasFocus(), wxT("Alt+Right") ) + FN(OnPlaySpeedDec), CaptureNotBusyFlag() ) ) ) }; return menu; } @@ -1273,6 +1263,27 @@ AttachedItem sAttachment3{ Shared( ExtraPlayAtSpeedMenu() ) }; +BaseItemSharedPtr ExtraSelectionItems() +{ + using Options = CommandManager::Options; + static BaseItemSharedPtr items{ + (FinderScope{ findCommandHandler }, + Items(wxT("MoveToLabel"), + Command(wxT("MoveToPrevLabel"), XXO("Move to Pre&vious Label"), + FN(OnMoveToPrevLabel), + CaptureNotBusyFlag() | TrackPanelHasFocus(), wxT("Alt+Left")), + Command(wxT("MoveToNextLabel"), XXO("Move to Ne&xt Label"), + FN(OnMoveToNextLabel), + CaptureNotBusyFlag() | TrackPanelHasFocus(), wxT("Alt+Right")) + )) }; + return items; +} + +AttachedItem sAttachment4{ + { wxT("Optional/Extra/Part1/Select"), { OrderingHint::End, {} } }, + Shared(ExtraSelectionItems()) +}; + } #undef FN