[longomatch] Stop player when the edit popup shows up



commit 7d93af72807f55007482f64b6a34d4ad340c70e0
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Oct 29 20:31:36 2014 +0100

    Stop player when the edit popup shows up

 LongoMatch.Services/Services/EventsManager.cs |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index 877aaf1..cccf2cd 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -323,7 +323,12 @@ namespace LongoMatch.Services
                        }
 
                        if (!openedProject.Dashboard.DisablePopupWindow) {
+                               bool playing = player.Playing;
+                               player.Pause ();
                                Config.GUIToolkit.EditPlay (play, openedProject, true, true, true, true);
+                               if (playing) {
+                                       player.Play ();
+                               }
                        }
 
                        Log.Debug (String.Format ("New play created start:{0} stop:{1} category:{2}",
@@ -389,18 +394,21 @@ namespace LongoMatch.Services
                                return;
                        }
                        
-                       if (action == KeyAction.None) {
+                       if (action == KeyAction.None || loadedPlay == null) {
                                return;
                        }
                        
                        switch (action) {
                        case KeyAction.EditEvent:
+                               bool playing = player.Playing;
+                               player.Pause ();
                                Config.GUIToolkit.EditPlay (loadedPlay, openedProject, true, true, true, 
true);
+                               if (playing) {
+                                       player.Play ();
+                               }
                                break;
                        case KeyAction.DeleteEvent:
-                               if (loadedPlay != null) {
-                                       DeletePlays (new List<TimelineEvent> { loadedPlay });
-                               }
+                               DeletePlays (new List<TimelineEvent> { loadedPlay });
                                break;
                        }
                }


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