1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Bug 2366 - Macros: Run does "Select All" ignoring setting in Tracks Behaviors Preferences

Reverted the wrong commit...needed to add an include anyway.
This commit is contained in:
Leland Lucius
2021-01-29 06:37:30 -06:00
parent 90a1783779
commit 76460c73da
4 changed files with 43 additions and 5 deletions

View File

@@ -21,8 +21,10 @@
#include "../ProjectFileManager.h"
#include "../ViewInfo.h"
#include "../export/Export.h"
#include "../SelectUtilities.h"
#include "../Shuttle.h"
#include "../ShuttleGui.h"
#include "../Track.h"
#include "../wxFileNameWrapper.h"
#include "CommandContext.h"
@@ -47,9 +49,18 @@ void ImportCommand::PopulateOrExchange(ShuttleGui & S)
S.EndMultiColumn();
}
bool ImportCommand::Apply(const CommandContext & context){
return ProjectFileManager::Get( context.project )
bool ImportCommand::Apply(const CommandContext & context)
{
bool wasEmpty = TrackList::Get( context.project ).Any().empty();
bool success = ProjectFileManager::Get( context.project )
.Import(mFileName, false);
if (success && wasEmpty)
{
SelectUtilities::SelectAllIfNone( context.project );
}
return success;
}