Update of /cvsroot/audacity/audacity-src/src In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv6540/src
Modified Files: Menus.cpp Log Message: Undo any changes on cross-track-type pastes. Index: Menus.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v retrieving revision 1.397 retrieving revision 1.398 diff -u -d -r1.397 -r1.398 --- Menus.cpp 4 Aug 2008 15:02:41 -0000 1.397 +++ Menus.cpp 4 Aug 2008 21:21:12 -0000 1.398 @@ -2838,6 +2838,9 @@ _("Pasting from one type of track into another is not allowed."), _("Error"), wxICON_ERROR, this); trackTypeMismatch = true; + //We /may/ have pasted something previous to this track, + //so we'll create an undo state so we can immediately undo. + pastedSomething = true; break; } if (c->GetLinked() && !n->GetLinked()) @@ -2896,7 +2899,7 @@ n = iter.Next(); } - if ( IsSticky() && ( (n && !c) || trackTypeMismatch ) ){ + if ( IsSticky() && (n && !c) ){ WaveTrack *tmp; c = clipIter.First(); if (c->GetKind() != Track::Wave){ @@ -2918,6 +2921,7 @@ n = iter.Next(); } } + // TODO: What if we clicked past the end of the track? if (pastedSomething) @@ -2932,6 +2936,11 @@ if (f) mTrackPanel->EnsureVisible(f); } + + if (trackTypeMismatch){ + OnUndo(); + mUndoManager.RemoveStateAt(mUndoManager.GetCurrentState()); + } } void AudacityProject::OnPasteOver() ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs