1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-04 10:43:08 +01:00

4th arg of ReportIfActionNotAllowed always == 3rd; eliminate it

This commit is contained in:
Paul Licameli
2019-06-09 02:05:39 -04:00
parent ca5259712c
commit e5a786c420
4 changed files with 5 additions and 7 deletions

View File

@@ -897,14 +897,14 @@ void MenuCreator::RebuildAllMenuBars()
}
bool MenuManager::ReportIfActionNotAllowed(
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd, CommandFlag mask )
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd )
{
auto &project = mProject;
bool bAllowed = TryToMakeActionAllowed( flags, flagsRqd, mask );
bool bAllowed = TryToMakeActionAllowed( flags, flagsRqd, flagsRqd );
if( bAllowed )
return true;
auto &cm = CommandManager::Get( project );
cm.TellUserWhyDisallowed( Name, flags & mask, flagsRqd & mask);
cm.TellUserWhyDisallowed( Name, flags & flagsRqd, flagsRqd);
return false;
}

View File

@@ -81,8 +81,7 @@ public:
// Command Handling
bool ReportIfActionNotAllowed(
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd,
CommandFlag mask );
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd );
bool TryToMakeActionAllowed(
CommandFlag & flags, CommandFlag flagsRqd, CommandFlag mask );

View File

@@ -1271,7 +1271,7 @@ bool CommandManager::HandleCommandEntry(const CommandListEntry * entry,
// NB: The call may have the side effect of changing flags.
bool allowed =
MenuManager::Get(*proj).ReportIfActionNotAllowed(
NiceName, flags, entry->flags, entry->flags );
NiceName, flags, entry->flags );
// 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.

View File

@@ -3278,7 +3278,6 @@ void EffectUIHost::OnApply(wxCommandEvent & evt)
MenuManager::Get(*mProject).ReportIfActionNotAllowed(
mEffect->GetTranslatedName(),
flags,
WaveTracksSelectedFlag | TimeSelectedFlag,
WaveTracksSelectedFlag | TimeSelectedFlag);
if (!allowed)
return;