mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-16 16:20:50 +02:00
Prompt for track selection when required
This commit is contained in:
parent
298e440e1b
commit
19014f22b7
@ -885,12 +885,10 @@ void AudacityProject::CreateMenusAndCommands()
|
||||
c->AddItem(wxT("CursSelEnd"), _("Selection En&d"), FN(OnCursorSelEnd),
|
||||
TimeSelectedFlag, TimeSelectedFlag);
|
||||
|
||||
// PRL: I thought these two should require TracksSelectedFlag but there
|
||||
// was complaint about an unhelpful error message
|
||||
c->AddItem(wxT("CursTrackStart"), _("Track &Start"), FN(OnCursorTrackStart), wxT("J"),
|
||||
AlwaysEnabledFlag, AlwaysEnabledFlag);
|
||||
TracksSelectedFlag, TracksSelectedFlag);
|
||||
c->AddItem(wxT("CursTrackEnd"), _("Track &End"), FN(OnCursorTrackEnd), wxT("K"),
|
||||
AlwaysEnabledFlag, AlwaysEnabledFlag);
|
||||
TracksSelectedFlag, TracksSelectedFlag);
|
||||
|
||||
c->AddItem(wxT("CursPrevClipBoundary"), _("Pre&vious Clip Boundary"), FN(OnCursorPrevClipBoundary), wxT(""),
|
||||
TrackPanelHasFocus | WaveTracksExistFlag, TrackPanelHasFocus | WaveTracksExistFlag);
|
||||
@ -1014,6 +1012,9 @@ void AudacityProject::CreateMenusAndCommands()
|
||||
c->EndSubMenu();
|
||||
|
||||
c->BeginSubMenu(_("&Pan"));
|
||||
// As Pan changes are not saved on Undo stack, pan settings for all tracks
|
||||
// in the project could very easily be lost unless we require the tracks to be selcted.
|
||||
c->SetDefaultFlags(TracksSelectedFlag, TracksSelectedFlag);
|
||||
c->AddItem(wxT("PanLeft"), _("&Left"), FN(OnPanLeft));
|
||||
c->AddItem(wxT("PanRight"), _("&Right"), FN(OnPanRight));
|
||||
c->AddItem(wxT("PanCenter"), _("&Center"), FN(OnPanCenter));
|
||||
|
@ -1307,6 +1307,9 @@ void CommandManager::TellUserWhyDisallowed( const wxString & Name, CommandFlag f
|
||||
}
|
||||
else if( missingFlags & WaveTracksSelectedFlag)
|
||||
reason = _("You must first select some audio to perform this action.\n(Selecting other kinds of track won't work.)");
|
||||
else if ( missingFlags & TracksSelectedFlag )
|
||||
// i18n-hint: %s will be replaced by the name of an action, such as "Remove Tracks".
|
||||
reason = wxString::Format(_("\"%s\" requires one or more tracks to be selected."), Name);
|
||||
// If the only thing wrong was no tracks, we do nothing and don't report a problem
|
||||
else if( missingFlags == TracksExistFlag )
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user