[ease] [editor] Fix transition undo handling.



commit a0cab9fda89ae8deb3cdd9d1923d1a05d6eb8cf5
Author: Nate Stedman <natesm gmail com>
Date:   Sun Jul 25 20:18:48 2010 -0400

    [editor] Fix transition undo handling.
    
    Redundant undo actions were being added,
    some actions were not being added. This
    has been fixed.

 src/ease-transition-pane.vala |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/ease-transition-pane.vala b/src/ease-transition-pane.vala
index c80c7ee..eee6688 100644
--- a/src/ease-transition-pane.vala
+++ b/src/ease-transition-pane.vala
@@ -143,6 +143,7 @@ public class Ease.TransitionPane : InspectorPane
 			action.add(slide, "variant");
 			if (!silence_undo) undo(action);
 			
+			var already_silenced = silence_undo;
 			silence_undo = true;
 			
 			// set the transition
@@ -157,7 +158,7 @@ public class Ease.TransitionPane : InspectorPane
 			{
 				critical("Transition not found in model");
 			}
-				
+			
 			// get the variants for the new transition
 			variant.model = slide.transition.variant_model();
 			
@@ -171,7 +172,7 @@ public class Ease.TransitionPane : InspectorPane
 					if (v == slide.variant)
 					{
 						variant.set_active_iter(itr);
-						silence_undo = false;
+						silence_undo = already_silenced;
 						return;
 					}
 				}
@@ -182,7 +183,7 @@ public class Ease.TransitionPane : InspectorPane
 				variant.set_active_iter(itr);
 			}
 			
-			silence_undo = false;
+			silence_undo = already_silenced;
 		});
 		
 		// allow the user to change the variant
@@ -285,6 +286,7 @@ public class Ease.TransitionPane : InspectorPane
 	
 	private void on_slide_notify(GLib.Object obj, GLib.ParamSpec spec)
 	{
+		var already_silenced = silence_undo;
 		silence_undo = true;
 		Gtk.TreeIter itr;
 		switch (spec.name)
@@ -324,6 +326,7 @@ public class Ease.TransitionPane : InspectorPane
 						if (v == slide.variant)
 						{
 							variant.set_active_iter(itr);
+							silence_undo = already_silenced;
 							return;
 						}
 					}
@@ -347,7 +350,7 @@ public class Ease.TransitionPane : InspectorPane
 				delay.sensitive = slide.automatically_advance;
 				break;
 		}
-		silence_undo = false;
+		silence_undo = already_silenced;
 	}
 	
 	protected override void slide_updated()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]