[longomatch] Add a new parameter to disable popup windows with autogened events



commit b9084e2f163a6ca67a46ef0a4a7252eb4fd4ef8a
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Apr 14 10:40:05 2015 +0200

    Add a new parameter to disable popup windows with autogened events

 LongoMatch.Core/Common/EventsBroker.cs       |    4 ++--
 LongoMatch.Core/Handlers/Handlers.cs         |    2 +-
 LongoMatch.GUI/Gui/Component/CodingWidget.cs |    2 +-
 LongoMatch.Services/EventsManager.cs         |    8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.Core/Common/EventsBroker.cs b/LongoMatch.Core/Common/EventsBroker.cs
index 1c35e5c..0a05a41 100644
--- a/LongoMatch.Core/Common/EventsBroker.cs
+++ b/LongoMatch.Core/Common/EventsBroker.cs
@@ -102,10 +102,10 @@ namespace LongoMatch.Core.Common
                                NewEventEvent (eventType, players, team, tags, start, stop, eventTime, score, 
card, null);
                }
 
-               public void EmitNewDashboardEvent (TimelineEvent evt, DashboardButton btn)
+               public void EmitNewDashboardEvent (TimelineEvent evt, DashboardButton btn, bool edit)
                {
                        if (NewDashboardEventEvent != null)
-                               NewDashboardEventEvent (evt, btn);
+                               NewDashboardEventEvent (evt, btn, edit);
                }
 
                public void EmitEventsDeleted (List<TimelineEvent> events)
diff --git a/LongoMatch.Core/Handlers/Handlers.cs b/LongoMatch.Core/Handlers/Handlers.cs
index da979bc..aee297f 100644
--- a/LongoMatch.Core/Handlers/Handlers.cs
+++ b/LongoMatch.Core/Handlers/Handlers.cs
@@ -40,7 +40,7 @@ namespace LongoMatch.Core.Handlers
                                                                                        List<Tag> tags,Time 
start,Time stop,Time EventTime,
                                                                                        Score 
score,PenaltyCard card,DashboardButton btn);
        /* Add a new play to the current project from Dashboard */
-       public delegate void NewDashboardEventHandler (TimelineEvent evt,DashboardButton btn);
+       public delegate void NewDashboardEventHandler (TimelineEvent evt,DashboardButton btn,bool edit);
        /* An event was edited */
        public delegate void TimeNodeChangedHandler (TimeNode tNode,Time time);
        public delegate void TimerNodeAddedHandler (Timer timer,TimeNode tn);
diff --git a/LongoMatch.GUI/Gui/Component/CodingWidget.cs b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
index 2df2349..d61efb0 100644
--- a/LongoMatch.GUI/Gui/Component/CodingWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
@@ -342,7 +342,7 @@ namespace LongoMatch.Gui.Component
                        play.Tags = tags ?? new List<Tag> ();
                        teamtagger.ResetSelection ();
                        selectedPlayers = null;
-                       Config.EventsBroker.EmitNewDashboardEvent (play, btn);
+                       Config.EventsBroker.EmitNewDashboardEvent (play, btn, true);
                }
 
                void HandlePlayersSubstitutionEvent (Team team, Player p1, Player p2,
diff --git a/LongoMatch.Services/EventsManager.cs b/LongoMatch.Services/EventsManager.cs
index 2340993..aa36152 100644
--- a/LongoMatch.Services/EventsManager.cs
+++ b/LongoMatch.Services/EventsManager.cs
@@ -291,7 +291,7 @@ namespace LongoMatch.Services
                        AddNewPlay (play);
                }
 
-               public void HandleNewPlay (TimelineEvent play, DashboardButton btn)
+               public void HandleNewDashboardEvent (TimelineEvent play, DashboardButton btn, bool edit)
                {
                        if (openedProject == null)
                                return;
@@ -305,7 +305,7 @@ namespace LongoMatch.Services
                                }
                        }
 
-                       if (!openedProject.Dashboard.DisablePopupWindow) {
+                       if (!openedProject.Dashboard.DisablePopupWindow && edit) {
                                if (projectType == ProjectType.FileProject) {
                                        bool playing = player.Playing;
                                        player.Pause ();
@@ -417,7 +417,7 @@ namespace LongoMatch.Services
                public bool Start ()
                {
                        Config.EventsBroker.NewEventEvent += OnNewTag;
-                       Config.EventsBroker.NewDashboardEventEvent += HandleNewPlay;
+                       Config.EventsBroker.NewDashboardEventEvent += HandleNewDashboardEvent;
                        Config.EventsBroker.EventsDeletedEvent += OnPlaysDeleted;
                        Config.EventsBroker.MoveToEventTypeEvent += OnPlayCategoryChanged;
                        Config.EventsBroker.DuplicateEventsEvent += OnDuplicatePlays;
@@ -445,7 +445,7 @@ namespace LongoMatch.Services
                public bool Stop ()
                {
                        Config.EventsBroker.NewEventEvent -= OnNewTag;
-                       Config.EventsBroker.NewDashboardEventEvent -= HandleNewPlay;
+                       Config.EventsBroker.NewDashboardEventEvent -= HandleNewDashboardEvent;
                        Config.EventsBroker.EventsDeletedEvent -= OnPlaysDeleted;
                        Config.EventsBroker.MoveToEventTypeEvent -= OnPlayCategoryChanged;
                        Config.EventsBroker.DuplicateEventsEvent -= OnDuplicatePlays;


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