1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 23:30:07 +02:00

Bug 1628 - Tracks > Align items two submenus deep

Fixed by adding a new on/off option, "Move  Selection With Tracks".
This commit is contained in:
James Crook 2017-04-08 11:54:25 +01:00
parent 5f9e8ef615
commit 221b0271ca
2 changed files with 29 additions and 7 deletions

View File

@ -994,12 +994,18 @@ void AudacityProject::CreateMenusAndCommands()
c->BeginSubMenu(_("&Align Tracks"));
c->BeginSubMenu(_("Just Move Tracks"));
//c->BeginSubMenu(_("Just Move Tracks"));
c->AddItemList(wxT("Align"), alignLabelsNoSync, FN(OnAlignNoSync));
c->AddSeparator();
c->AddItemList(wxT("Align"), alignLabels, FN(OnAlign));
c->AddSeparator();
c->AddCheck(wxT("MoveSelectionWithTracks"), _("Move Selection with Tracks (on/off)"),
FN(OnMoveSelectionWithTracks),
gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), 1L),
AlwaysEnabledFlag, AlwaysEnabledFlag);
c->EndSubMenu();
#if 0
// TODO: Can these labels be made clearer? Do we need this sub-menu at all?
c->BeginSubMenu(_("Move Sele&ction and Tracks"));
@ -1009,8 +1015,7 @@ void AudacityProject::CreateMenusAndCommands()
AudioIONotBusyFlag | TracksSelectedFlag);
c->EndSubMenu();
c->EndSubMenu();
#endif
c->SetDefaultFlags(AudioIONotBusyFlag, AudioIONotBusyFlag);
@ -1040,7 +1045,8 @@ void AudacityProject::CreateMenusAndCommands()
#ifdef EXPERIMENTAL_SYNC_LOCK
c->AddSeparator();
c->AddCheck(wxT("SyncLock"), _("Sync-&Lock Tracks (on/off)"), FN(OnSyncLock), 0,
c->AddCheck(wxT("SyncLock"), _("Sync-&Lock Tracks (on/off)"), FN(OnSyncLock),
gPrefs->Read(wxT("/GUI/SyncLockTracks"), 0L),
AlwaysEnabledFlag, AlwaysEnabledFlag);
#endif
@ -6638,13 +6644,17 @@ void AudacityProject::OnAlignNoSync(int index)
void AudacityProject::OnAlign(int index)
{
HandleAlign(index, false);
bool bMoveWith;
gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), &bMoveWith, true);
HandleAlign(index, bMoveWith);
}
/*
// Now handled in OnAlign.
void AudacityProject::OnAlignMoveSel(int index)
{
HandleAlign(index, true);
}
*/
#ifdef EXPERIMENTAL_SCOREALIGN
// rough relative amount of time to compute one
@ -7138,6 +7148,15 @@ int AudacityProject::DoAddLabel(const SelectedRegion &region, bool preserveFocus
return index;
}
void AudacityProject::OnMoveSelectionWithTracks()
{
bool bMoveWith;
gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), &bMoveWith, true);
gPrefs->Write(wxT("/GUI/MoveSelectionWithTracks"), !bMoveWith);
gPrefs->Flush();
}
void AudacityProject::OnSyncLock()
{
bool bSyncLockTracks;
@ -7151,6 +7170,8 @@ void AudacityProject::OnSyncLock()
mTrackPanel->Refresh(false);
}
void AudacityProject::OnAddLabel()
{
DoAddLabel(mViewInfo.selectedRegion);

View File

@ -410,7 +410,7 @@ void OnCursorClipBoundary(bool next);
void OnAlignNoSync(int index);
void OnAlign(int index);
void OnAlignMoveSel(int index);
//void OnAlignMoveSel(int index);
void HandleAlign(int index, bool moveSel);
size_t mAlignLabelsCount;
@ -425,6 +425,7 @@ void OnNewLabelTrack();
void OnNewTimeTrack();
void OnTimerRecord();
void OnRemoveTracks();
void OnMoveSelectionWithTracks();
void OnSyncLock();
void OnAddLabel();
void OnAddLabelPlaying();