[longomatch] Re attach player when resetting the GUI



commit e5ebfba5e137135c96da5291f7bb7ce2c9d17ea7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Jan 27 20:34:13 2012 +0100

    Re attach player when resetting the GUI

 LongoMatch.GUI/Gui/MainWindow.cs |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 2030459..2872334 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -304,14 +304,15 @@ namespace LongoMatch.Gui
 			if (detach == detachedPlayer)
 				return;
 				
+			detachedPlayer = detach;
+			
 			if (detach) {
 				Log.Debug("Detaching player");
 				playerWindow = new Gtk.Window(Constants.SOFTWARE_NAME);
 				playerWindow.Icon = Stetic.IconLoader.LoadIcon(this, "longomatch", IconSize.Button);
 				playerWindow.DeleteEvent += (o, args) => DetachPlayer(false);
 				playerWindow.Show();
-				this.player.Reparent(playerWindow);
-				detachedPlayer = true;
+				player.Reparent(playerWindow);
 				buttonswidget.Visible = true;
 				timeline.Visible = true;
 				if (Config.useGameUnits) {
@@ -322,8 +323,8 @@ namespace LongoMatch.Gui
 				ToggleAction action;
 				
 				Log.Debug("Attaching player again");
-				this.player.Reparent(this.videowidgetsbox);
-				detachedPlayer = false;
+				player.Reparent(this.videowidgetsbox);
+				playerWindow.Destroy();
 				
 				if (ManualTaggingViewAction.Active)
 					action = ManualTaggingViewAction;
@@ -404,6 +405,8 @@ namespace LongoMatch.Gui
 			notes.Visible = false;
 			selectedTimeNode = null;
 			MakeActionsSensitive(false, projectType);
+			if (detachedPlayer)
+				DetachPlayer(false);
 		}
 
 		private void MakeActionsSensitive(bool sensitive, ProjectType projectType) {



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