mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 07:39:42 +02:00
Revert "Bug 2366 - Macros: Run does "Select All" ignoring setting in Tracks Behaviors Preferences"
This reverts commit 1478abf3d02573538e95769a4aa3548c59f4bc19. Removing until some questions are answered.
This commit is contained in:
parent
e5ca3cefba
commit
90a1783779
@ -549,19 +549,11 @@ bool MacroCommands::ApplyEffectCommand(
|
||||
|
||||
AudacityProject *project = &mProject;
|
||||
|
||||
// IF nothing selected, THEN select everything depending
|
||||
// on preferences setting.
|
||||
// FIXME: for later versions may want to not select-all in batch mode.
|
||||
// IF nothing selected, THEN select everything
|
||||
// (most effects require that you have something selected).
|
||||
if( plug->GetPluginType() != PluginTypeAudacityCommand )
|
||||
{
|
||||
if( !SelectUtilities::SelectAllIfNoneAndAllowed( *project ) )
|
||||
{
|
||||
AudacityMessageBox(
|
||||
// i18n-hint: %s will be replaced by the name of an action, such as "Remove Tracks".
|
||||
XO("\"%s\" requires one or more tracks to be selected.").Format(friendlyCommand));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
SelectUtilities::SelectAllIfNone( *project );
|
||||
|
||||
bool res = false;
|
||||
|
||||
|
@ -90,24 +90,6 @@ void SelectAllIfNone( AudacityProject &project )
|
||||
DoSelectAllAudio( project );
|
||||
}
|
||||
|
||||
// Select the full time range, if no time range is selected and
|
||||
// selecting is allowed. Returns "false" selecting not allowed.
|
||||
bool SelectAllIfNoneAndAllowed( AudacityProject &project )
|
||||
{
|
||||
auto allowed = gPrefs->ReadBool(wxT("/GUI/SelectAllOnNone"), false);
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
auto flags = MenuManager::Get( project ).GetUpdateFlags();
|
||||
|
||||
if((flags & TracksSelectedFlag()).none() ||
|
||||
viewInfo.selectedRegion.isPoint()) {
|
||||
if (!allowed) {
|
||||
return false;
|
||||
}
|
||||
DoSelectAllAudio( project );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DoListSelection
|
||||
(AudacityProject &project, Track *t, bool shift, bool ctrl, bool modifyState)
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ namespace SelectUtilities {
|
||||
void DoSelectTimeAndTracks(
|
||||
AudacityProject &project, bool bAllTime, bool bAllTracks);
|
||||
void SelectAllIfNone( AudacityProject &project );
|
||||
bool SelectAllIfNoneAndAllowed( AudacityProject &project );
|
||||
void SelectNone( AudacityProject &project );
|
||||
void DoListSelection(
|
||||
AudacityProject &project, Track *t,
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "../ProjectFileManager.h"
|
||||
#include "../ViewInfo.h"
|
||||
#include "../export/Export.h"
|
||||
#include "../SelectUtilities.h"
|
||||
#include "../Shuttle.h"
|
||||
#include "../ShuttleGui.h"
|
||||
#include "../wxFileNameWrapper.h"
|
||||
@ -48,18 +47,9 @@ void ImportCommand::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndMultiColumn();
|
||||
}
|
||||
|
||||
bool ImportCommand::Apply(const CommandContext & context)
|
||||
{
|
||||
bool wasEmpty = TrackList::Get( context.project ).Any().empty();
|
||||
bool success = ProjectFileManager::Get( context.project )
|
||||
bool ImportCommand::Apply(const CommandContext & context){
|
||||
return ProjectFileManager::Get( context.project )
|
||||
.Import(mFileName, false);
|
||||
|
||||
if (success && wasEmpty)
|
||||
{
|
||||
SelectUtilities::SelectAllIfNone( context.project );
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user