1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 17:11:20 +01:00

Bug 240 - Time track selected by itself can't be removed with Tracks>Remove Tracks

This commit is contained in:
James Crook
2019-07-17 15:58:42 +01:00
parent 9d1b75a5d7
commit 43af7b3265
3 changed files with 18 additions and 2 deletions

View File

@@ -51,6 +51,13 @@ bool TracksSelectedPred( const AudacityProject &project )
return !range.empty();
};
// This predicate includes time tracks too.
bool AnyTracksSelectedPred( const AudacityProject &project )
{
auto range = TrackList::Get( project ).Selected();
return !range.empty();
};
bool AudioIOBusyPred( const AudacityProject &project )
{
return AudioIOBase::Get()->IsAudioTokenActive(
@@ -147,7 +154,15 @@ const ReservedCommandFlag
CommandFlagOptions{}.DisableDefaultMessage()
},
TracksSelectedFlag{
TracksSelectedPred,
TracksSelectedPred, // exclude TimeTracks
{ []( const wxString &Name ){ return wxString::Format(
// i18n-hint: %s will be replaced by the name of an action, such as "Remove Tracks".
_("\"%s\" requires one or more tracks to be selected."),
Name
); },"FAQ:Errors:Select Tracks" }
},
AnyTracksSelectedFlag{
AnyTracksSelectedPred, // Allow TimeTracks
{ []( const wxString &Name ){ return wxString::Format(
// i18n-hint: %s will be replaced by the name of an action, such as "Remove Tracks".
_("\"%s\" requires one or more tracks to be selected."),