1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-13 08:06:32 +01:00

Disallow AutoSelect on dangerous commands.

Commands flagged with NoAutoSelect will not auto select, even if the user has asked for it.  This is used for Cut and 3 different kinds of delete.  We later might extend it to fades and repair.
This commit is contained in:
James Crook
2017-06-09 22:36:05 +01:00
parent 64a28861a0
commit 7341bff9e0
4 changed files with 15 additions and 5 deletions

View File

@@ -56,6 +56,7 @@ enum CommandFlag : unsigned long long
HasWaveDataFlag = 0x800000000ULL, // jkc
PlayableTracksExistFlag = 0x1000000000ULL,
AudioTracksSelectedFlag = 0x2000000000ULL,
NoAutoSelect = 0x4000000000ULL, // jkc
NoFlagsSpecifed = ~0ULL
};

View File

@@ -1336,8 +1336,11 @@ bool CommandManager::HandleCommandEntry(const CommandListEntry * entry,
// NB: The call may have the side effect of changing flags.
bool allowed = proj->ReportIfActionNotAllowed(
NiceName, flags, entry->flags, combinedMask );
// If the function was disallowed, it STILL should count as having been
// handled (by doing nothing or by telling the user of the problem).
// Otherwise we may get other handlers having a go at obeying the command.
if (!allowed)
return false;
return true;
}
(*(entry->callback))(entry->index, evt);