[longomatch] Fix tags display for subcateogires without the QuickTag options



commit a40dea5162c7435fcc407dcc2aee3614c38ba0f4
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Mar 19 17:30:07 2013 +0100

    Fix tags display for subcateogires without the QuickTag options

 LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs |    2 +-
 LongoMatch.GUI/Gui/Dialog/TaggerDialog.cs     |    8 +++++---
 LongoMatch.GUI/Gui/GUIToolkit.cs              |    4 ++--
 LongoMatch.Services/Services/EventsManager.cs |    9 +++++----
 4 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
index 84349b4..ceb8510 100644
--- a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
@@ -66,7 +66,7 @@ namespace LongoMatch.Interfaces.GUI
                
                void ManageJobs(IRenderingJobsManager manager);
                
-               void TagPlay(Play play, TeamTemplate local, TeamTemplate visitor);
+               void TagPlay(Play play, TeamTemplate local, TeamTemplate visitor, bool showAllTags);
                void DrawingTool(Image pixbuf, Play play, int stopTime);
        }
 }
diff --git a/LongoMatch.GUI/Gui/Dialog/TaggerDialog.cs b/LongoMatch.GUI/Gui/Dialog/TaggerDialog.cs
index 12a1524..09856b7 100644
--- a/LongoMatch.GUI/Gui/Dialog/TaggerDialog.cs
+++ b/LongoMatch.GUI/Gui/Dialog/TaggerDialog.cs
@@ -33,8 +33,10 @@ namespace LongoMatch.Gui.Dialog
        {
                private TeamTemplate localTeamTemplate;
                private TeamTemplate visitorTeamTemplate;
-
-               public TaggerDialog(Play play, TeamTemplate localTeamTemplate, TeamTemplate 
visitorTeamTemplate)
+               bool showAllSubcateogires;
+               
+               public TaggerDialog(Play play, TeamTemplate localTeamTemplate,
+                                   TeamTemplate visitorTeamTemplate, bool showAllSubcategories)
                {
                        this.Build();
                        
@@ -47,7 +49,7 @@ namespace LongoMatch.Gui.Dialog
                        
                        /* Iterate over all subcategories, adding a widget only for the FastTag ones */
                        foreach (var subcat in play.Category.SubCategories) {
-                               if (!subcat.FastTag)
+                               if (!subcat.FastTag && !showAllSubcategories)
                                        continue;
                                if (subcat is TagSubCategory) {
                                        var tagcat = subcat as TagSubCategory;
diff --git a/LongoMatch.GUI/Gui/GUIToolkit.cs b/LongoMatch.GUI/Gui/GUIToolkit.cs
index c900441..a474030 100644
--- a/LongoMatch.GUI/Gui/GUIToolkit.cs
+++ b/LongoMatch.GUI/Gui/GUIToolkit.cs
@@ -183,8 +183,8 @@ namespace LongoMatch.Gui
                                sd.Destroy();
                }
                
-               public void TagPlay (Play play, TeamTemplate local, TeamTemplate visitor) {
-                       TaggerDialog tg = new TaggerDialog(play, local, visitor);
+               public void TagPlay (Play play, TeamTemplate local, TeamTemplate visitor, bool showAllTags) {
+                       TaggerDialog tg = new TaggerDialog(play, local, visitor, showAllTags);
                        tg.TransientFor = mainWindow as Gtk.Window;
                        tg.Run();
                        tg.Destroy();
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index 7c775a6..d871924 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -148,7 +148,7 @@ namespace LongoMatch.Services
                        mainWindow.AddPlay(play);
                        /* Tag subcategories of the new play */
                        if (!Config.FastTagging)
-                               LaunchPlayTagger(play);
+                               LaunchPlayTagger(play, false);
                        if (projectType == ProjectType.FileProject) {
                                player.Play();
                        }
@@ -201,8 +201,9 @@ namespace LongoMatch.Services
                        AddNewPlay(startTime, stopTime, category);
                }
 
-               private void LaunchPlayTagger(Play play) {
-                       guiToolkit.TagPlay(play, openedProject.LocalTeamTemplate, 
openedProject.VisitorTeamTemplate);
+               private void LaunchPlayTagger(Play play, bool showAllTags) {
+                       guiToolkit.TagPlay(play, openedProject.LocalTeamTemplate,
+                                          openedProject.VisitorTeamTemplate, showAllTags);
                }
 
                protected virtual void OnPlaySelected(Play play)
@@ -272,7 +273,7 @@ namespace LongoMatch.Services
                }
 
                protected virtual void OnTagPlay(Play play) {
-                       LaunchPlayTagger(play);
+                       LaunchPlayTagger(play, true);
                }
                
                protected virtual void OnPlayCategoryChanged(Play play, Category cat)


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