From f0702fb54b6451e56a06ee57e5c8826b98a86915 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Fri, 7 Jul 2017 13:31:48 +0100 Subject: [PATCH] 1678: Cursor to track start/end misbehaves when no tracks selected Problem: With no tracks selected, the commands cursor to track start/end set the cursor position to a silly high value or undefined respectively. Simple fix: Set the flags on the commands to TracksSelectedFlag, as they were before the menus were reorganised. Note that after this fix, with tracks present, but none selected, these commands cause a disallowed dialog to open, saying that there was a problem with the last action. I don't know if this behaviour is now expected. --- src/Menus.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index 8f7c5575a..70f9b3b06 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -866,8 +866,10 @@ void AudacityProject::CreateMenusAndCommands() c->AddItem(wxT("CursSelStart"), _("Selection Star&t"), FN(OnCursorSelStart)); c->AddItem(wxT("CursSelEnd"), _("Selection En&d"), FN(OnCursorSelEnd)); - c->AddItem(wxT("CursTrackStart"), _("Track &Start"), FN(OnCursorTrackStart), wxT("J")); - c->AddItem(wxT("CursTrackEnd"), _("Track &End"), FN(OnCursorTrackEnd), wxT("K")); + c->AddItem(wxT("CursTrackStart"), _("Track &Start"), FN(OnCursorTrackStart), wxT("J"), + TracksSelectedFlag, TracksSelectedFlag); + c->AddItem(wxT("CursTrackEnd"), _("Track &End"), FN(OnCursorTrackEnd), wxT("K"), + TracksSelectedFlag, TracksSelectedFlag); c->AddItem(wxT("CursPrevClipBoundary"), _("Pre&vious Clip Boundary"), FN(OnCursorPrevClipBoundary), wxT(""), TrackPanelHasFocus | WaveTracksExistFlag, TrackPanelHasFocus | WaveTracksExistFlag);