[longomatch] Include players tagged in the tagging widget



commit 1a6f1e5ac52933282633ef188a5d4534da835af6
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Aug 26 16:48:31 2014 +0200

    Include players tagged in the tagging widget

 LongoMatch.GUI/Gui/Component/CodingWidget.cs    |   15 +++++++++------
 LongoMatch.GUI/Gui/Component/DashboardWidget.cs |    8 ++++++--
 2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/CodingWidget.cs b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
index c18bdbf..956ea63 100644
--- a/LongoMatch.GUI/Gui/Component/CodingWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
@@ -16,6 +16,7 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 //
 using System;
+using System.Linq;
 using System.Collections.Generic;
 using Gtk;
 using LongoMatch.Handlers;
@@ -72,6 +73,7 @@ namespace LongoMatch.Gui.Component
                        
                        buttonswidget.Mode = TagMode.Free;
                        buttonswidget.FitMode = FitMode.Fit;
+                       buttonswidget.NewTagEvent += HandleNewTagEvent;
                }
 
                protected override void OnDestroyed ()
@@ -220,13 +222,14 @@ namespace LongoMatch.Gui.Component
 
                void HandlePlayersSelectionChangedEvent (List<Player> players)
                {
-                       if (loadedPlay != null) {
-                               loadedPlay.Players = players;
-                               Config.EventsBroker.EmitTeamTagsChanged ();
-                       } else {
-                               selectedPlayers = players;
-                       }
+                       selectedPlayers = players.ToList();
                }
+               
+               void HandleNewTagEvent (TaggerButton tagger, List<Player> plays, List<Tag> tags, Time start, 
Time stop)
+               {
+                       Config.EventsBroker.EmitNewTag (tagger, selectedPlayers, tags, start, stop);
+               }
+
        }
 }
 
diff --git a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
index 23a264e..c5fc71d 100644
--- a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
@@ -253,13 +253,17 @@ namespace LongoMatch.Gui.Component
                }
                
                void HandleNewTagEvent (TaggerButton button, List<Player> players,
-                                       List<Tag> tags, Time start, Time stop)
+                                     List<Tag> tags, Time start, Time stop)
                {
                        if (button is TagButton || button is Timer) {
                                return;
                        }
                        
-                       Config.EventsBroker.EmitNewTag (button, players, tags, start, stop);
+                       /* Forward event until we have players integrted in the dashboard layout */
+                       if (NewTagEvent != null) {
+                               NewTagEvent (button , players, tags, start, stop);
+                       }
+                       //Config.EventsBroker.EmitNewTag (button, players, tags, start, stop);
                }
 
                void HandleAddNewTagEvent (TaggerButton taggerbutton)


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