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

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

This commit is contained in:
Leland Lucius
2021-01-29 05:08:05 -06:00
parent bcb4bb91c7
commit 1478abf3d0
4 changed files with 42 additions and 5 deletions

View File

@@ -21,6 +21,7 @@
#include "../ProjectFileManager.h"
#include "../ViewInfo.h"
#include "../export/Export.h"
#include "../SelectUtilities.h"
#include "../Shuttle.h"
#include "../ShuttleGui.h"
#include "../wxFileNameWrapper.h"
@@ -47,9 +48,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;
}