[longomatch] Improve filters



commit d6e82fae7ac20c7befa7c1c35b33d3e91cc74767
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Aug 1 21:13:00 2012 +0200

    Improve filters

 LongoMatch.Core/Makefile.am                        |    1 +
 LongoMatch.Core/Store/Templates/TeamTemplate.cs    |    2 +-
 LongoMatch.GUI/Gui/Component/CategoriesFilter.cs   |  106 -----------------
 .../Gui/Component/PlaysSelectionWidget.cs          |   23 ++++-
 .../Gui/TreeView/CategoriesFilterTreeView.cs       |  124 +++++++++++++++++++
 LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs      |  113 ++++++++++++++++++
 .../PlayersFilterTreeView.cs}                      |  125 +++++++++----------
 LongoMatch.GUI/LongoMatch.GUI.mdp                  |    7 +-
 LongoMatch.GUI/Makefile.am                         |    8 +-
 .../LongoMatch.Gui.Component.CategoriesFilter.cs   |   19 ---
 .../LongoMatch.Gui.Component.PlayersFilter.cs      |   32 -----
 ...ongoMatch.Gui.Component.PlaysSelectionWidget.cs |   32 +-----
 .../LongoMatch.Gui.Dialog.Win32CalendarDialog.cs   |    4 +-
 .../gtk-gui/LongoMatch.Gui.MainWindow.cs           |    2 +-
 LongoMatch.GUI/gtk-gui/gui.stetic                  |   76 +-----------
 LongoMatch.GUI/gtk-gui/objects.xml                 |   64 +++++++----
 16 files changed, 377 insertions(+), 361 deletions(-)
---
diff --git a/LongoMatch.Core/Makefile.am b/LongoMatch.Core/Makefile.am
index f8e46b0..edc0453 100644
--- a/LongoMatch.Core/Makefile.am
+++ b/LongoMatch.Core/Makefile.am
@@ -17,6 +17,7 @@ SOURCES = \
 	Common/Job.cs \
 	Common/Log.cs \
 	Common/PlayList.cs \
+	Common/PlaysFilter.cs \
 	Common/SerializableObject.cs \
 	Common/VideoStandards.cs \
 	Config.cs \
diff --git a/LongoMatch.Core/Store/Templates/TeamTemplate.cs b/LongoMatch.Core/Store/Templates/TeamTemplate.cs
index 2b3a8e2..6b0b9e7 100644
--- a/LongoMatch.Core/Store/Templates/TeamTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/TeamTemplate.cs
@@ -35,7 +35,7 @@ namespace LongoMatch.Store.Templates
 		private const int MAX_HEIGHT=100;
 		
 		public TeamTemplate() {
-			TeamName = Catalog.GetString("default");
+			TeamName = Catalog.GetString("Team");
 		}
 
 		public String Name {
diff --git a/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs b/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
index 0085b4b..891a04a 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
@@ -17,6 +17,8 @@
 // 
 using System;
 using System.Collections.Generic;
+using Mono.Unix;
+using Gtk;
 
 using LongoMatch.Common;
 using LongoMatch.Handlers;
@@ -37,12 +39,15 @@ namespace LongoMatch.Gui.Component
 		public event TagPlayHandler TagPlay;
 		
 		Project project;
+		PlayersFilterTreeView playersfilter;
+		CategoriesFilterTreeView categoriesfilter;
 		
 		public PlaysSelectionWidget ()
 		{
 			this.Build ();
 			localPlayersList.Team = Team.LOCAL;
 			visitorPlayersList.Team = Team.VISITOR;
+			AddFilters();
 			ConnectSignals();
 		}
 		
@@ -62,8 +67,8 @@ namespace LongoMatch.Gui.Component
 			localPlayersList.Filter = filter;
 			visitorPlayersList.Filter = filter;
 			UpdateTeamsModels();
-			playersfilter.SetFilter(filter, project.LocalTeamTemplate, project.VisitorTeamTemplate);
-			categoriesfilter.SetFilter(filter, project.Categories);
+			playersfilter.SetFilter(filter, project);
+			categoriesfilter.SetFilter(filter, project);
 		}
 		
 		public void Clear() {
@@ -97,6 +102,20 @@ namespace LongoMatch.Gui.Component
 		}
 		#endregion
 		
+		void AddFilters() {
+			ScrolledWindow s1 = new ScrolledWindow();
+			ScrolledWindow s2 = new ScrolledWindow();
+			
+			playersfilter = new PlayersFilterTreeView();
+			categoriesfilter = new CategoriesFilterTreeView();
+			
+			s1.Add(categoriesfilter);
+			s2.Add(playersfilter);
+			notebook1.AppendPage(s1, new Gtk.Label(Catalog.GetString("Categories filter")));
+			notebook1.AppendPage(s2, new Gtk.Label(Catalog.GetString("Players filter")));
+			notebook1.ShowAll();
+		}
+		
 		private void ConnectSignals() {
 			playsList.TimeNodeDeleted += EmitPlaysDeleted;
 
diff --git a/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs b/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs
new file mode 100644
index 0000000..47ac63a
--- /dev/null
+++ b/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs
@@ -0,0 +1,124 @@
+// 
+//  Copyright (C) 2012 Andoni Morales Alastruey
+// 
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+// 
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+// 
+using System;
+using Gtk;
+using Mono.Unix;
+
+using LongoMatch.Common;
+using LongoMatch.Interfaces;
+using LongoMatch.Store;
+using LongoMatch.Store.Templates;
+
+namespace LongoMatch.Gui.Component
+{
+
+    [System.ComponentModel.Category("LongoMatch")]
+	[System.ComponentModel.ToolboxItem(true)]
+	public class CategoriesFilterTreeView: FilterTreeViewBase
+	{
+		Categories categories;
+		
+		public CategoriesFilterTreeView (): base()
+		{
+			firstColumnName = Catalog.GetString("Category");
+			HeadersVisible = false;
+		}
+		
+		public override void SetFilter (PlaysFilter filter, Project project) {
+			this.categories = project.Categories;
+			base.SetFilter(filter, project);
+		}
+		
+		protected override void FillTree () {
+			store = new TreeStore (typeof (object), typeof (bool));
+			
+			foreach (Category cat in  categories) {
+				TreeIter catIter;
+				
+				catIter = store.AppendValues(cat, filter.VisibleCategories.Contains(cat));
+				/*
+				foreach (var subcat in cat.SubCategories) {
+					TreeIter subcatIter;
+					if (subcat is TagSubCategory) {
+						subcatIter = store.AppendValues(catIter, subcat, true);
+						Console.WriteLine (subcat.Name);
+						foreach (string desc in subcat.ElementsDesc()) {
+							store.AppendValues(subcatIter, new StringObject{Value=desc}, true);
+						}
+					}
+				}
+				*/
+				
+			}
+			Model = store;
+		}
+ 
+		protected override void HandleFilterCellToggled (object o, ToggledArgs args)
+		{
+			Gtk.TreeIter iter;
+			
+			if (store.GetIterFromString(out iter, args.Path))
+			{
+				object obj = store.GetValue(iter, 0);
+				Category cat = obj as Category;
+				if (cat == null)
+					return;
+					
+				bool active = !((bool) store.GetValue(iter, 1));
+				
+				if (active) {
+					filter.UnFilterCategory(cat);
+				} else {
+					filter.FilterCategory(cat);
+				}
+			
+				store.SetValue(iter, 1, active);
+				filter.Update();
+			}
+		}
+		
+		protected override void RenderColumn (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+		{
+			object obj = store.GetValue(iter, 0);
+			string text = "";
+			
+			if (obj is Category) {
+				Category cat = obj as Category;
+				text = cat.Name;
+			}
+			else if (obj is ISubCategory) {
+				ISubCategory subCat = obj as ISubCategory;
+				text = subCat.Name;
+			}
+			else if (obj is StringObject){
+				text = (obj as StringObject).Value;
+			}
+			
+			(cell as CellRendererText).Text = text;
+		}
+		
+		protected override void Select(bool select_all) {
+		}
+	}
+	
+	class StringObject
+	{
+		public string Value {get;set;}
+	}
+}
+
diff --git a/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs b/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs
new file mode 100644
index 0000000..eac2593
--- /dev/null
+++ b/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs
@@ -0,0 +1,113 @@
+// 
+//  Copyright (C) 2012 Andoni Morales Alastruey
+// 
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+// 
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+// 
+using System;
+using Gtk;
+using Gdk;
+using Mono.Unix;
+
+using LongoMatch.Common;
+using LongoMatch.Store;
+using LongoMatch.Store.Templates;
+
+namespace LongoMatch.Gui.Component
+{
+
+	[System.ComponentModel.Category("LongoMatch")]
+	[System.ComponentModel.ToolboxItem(true)]
+	public abstract class FilterTreeViewBase: TreeView
+	{
+		protected Menu playersMenu;
+		protected Project project;
+		protected string firstColumnName = "";
+		protected TreeStore store;
+		protected PlaysFilter filter;
+		
+		public FilterTreeViewBase ()
+		{
+			PrepareTree();
+			CreateMenu();
+		}
+		
+		public virtual void SetFilter (PlaysFilter filter, Project project) {
+			this.project  = project;
+			this.filter = filter;
+			FillTree();
+		}
+		
+		private void PrepareTree () {
+			TreeViewColumn nameColumn = new TreeViewColumn ();
+			CellRendererText nameCell = new CellRendererText ();
+			nameColumn.Title = Catalog.GetString(firstColumnName);
+			nameColumn.PackStart (nameCell, true);
+			nameColumn.SetCellDataFunc (nameCell, new TreeCellDataFunc (RenderColumn));
+ 
+			TreeViewColumn filterColumn = new TreeViewColumn ();
+			CellRendererToggle filterCell = new CellRendererToggle ();
+			filterColumn.Title = Catalog.GetString("Visible");
+			filterCell.Toggled += HandleFilterCellToggled;
+			filterColumn.PackStart (filterCell, true);
+			filterColumn.AddAttribute(filterCell, "active", 1);
+
+			AppendColumn (nameColumn);
+			AppendColumn (filterColumn);
+		}
+		
+		void CreateMenu() {
+			Gtk.Action select_all;
+			Gtk.Action select_none;
+			UIManager manager;
+			ActionGroup g;
+
+			manager= new UIManager();
+			g = new ActionGroup("MenuGroup");
+
+			select_all = new Gtk.Action("AllAction", Mono.Unix.Catalog.GetString("Select all"), null, "gtk-edit");
+			select_none = new Gtk.Action("NoneAction", Mono.Unix.Catalog.GetString("Unselect all"), null, "gtk-edit");
+
+			g.Add(select_all, null);
+			g.Add(select_none, null);
+
+			manager.InsertActionGroup(g,0);
+
+			manager.AddUiFromString("<ui>"+
+			                        "  <popup action='Menu'>"+
+			                        "    <menuitem action='AllAction'/>"+
+			                        "    <menuitem action='NoneAction'/>"+
+			                        "  </popup>"+
+			                        "</ui>");
+
+			playersMenu = manager.GetWidget("/Menu") as Menu;
+
+			select_all.Activated += (sender, e) => Select(true);
+			select_none.Activated += (sender, e) => Select(false);
+		}
+
+		protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
+		{
+			if((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
+				playersMenu.Popup();
+			return base.OnButtonPressEvent (evnt);
+		}
+
+		protected abstract void FillTree ();
+		protected abstract void HandleFilterCellToggled (object o, ToggledArgs args);
+		protected abstract void RenderColumn (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter);
+		protected abstract void Select(bool select_all);
+	}
+}
+
diff --git a/LongoMatch.GUI/Gui/Component/PlayersFilter.cs b/LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
similarity index 50%
rename from LongoMatch.GUI/Gui/Component/PlayersFilter.cs
rename to LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
index 385cd1a..e707e8f 100644
--- a/LongoMatch.GUI/Gui/Component/PlayersFilter.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
@@ -16,8 +16,9 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 // 
 using System;
-using Mono.Unix;
 using Gtk;
+using Gdk;
+using Mono.Unix;
 
 using LongoMatch.Common;
 using LongoMatch.Store;
@@ -25,50 +26,31 @@ using LongoMatch.Store.Templates;
 
 namespace LongoMatch.Gui.Component
 {
+
+	[System.ComponentModel.Category("LongoMatch")]
 	[System.ComponentModel.ToolboxItem(true)]
-	public partial class PlayersFilter : Gtk.Bin
+	public class PlayersFilterTreeView: FilterTreeViewBase
 	{
-		PlaysFilter filter;
 		TeamTemplate local, visitor;
 		Player localTeam, visitorTeam;
 		TreeIter localIter, visitorIter;
 		
-		public PlayersFilter ()
+		public PlayersFilterTreeView (): base()
 		{
-			this.Build ();
-			localTeam = new Player();
 			visitorTeam = new Player();
-			CreateTree();
+			localTeam = new Player();
+			HeadersVisible = false;
 		}
 		
-		public void SetFilter (PlaysFilter filter, TeamTemplate local, TeamTemplate visitor) {
-			this.filter  = filter;
-			this.local = local;
-			this.visitor = visitor;
+		public override void SetFilter (PlaysFilter filter, Project project) {
+			this.local = project.LocalTeamTemplate;
+			this.visitor = project.VisitorTeamTemplate;
 			localTeam.Name = local.TeamName;
 			visitorTeam.Name = visitor.TeamName;
-			FillTree();
+			base.SetFilter(filter, project);
 		}
 		
-		private void CreateTree () {
-			TreeViewColumn nameColumn = new TreeViewColumn ();
-			CellRendererText nameCell = new CellRendererText ();
-			nameColumn.Title = Catalog.GetString("Player");
-			nameColumn.PackStart (nameCell, true);
-			nameColumn.SetCellDataFunc (nameCell, new TreeCellDataFunc (RenderPlayer));
- 
-			TreeViewColumn filterColumn = new TreeViewColumn ();
-			CellRendererToggle filterCell = new CellRendererToggle ();
-			filterColumn.Title = Catalog.GetString("Filter");
-			filterCell.Toggled += HandleFilterCellToggled;
-			filterColumn.PackStart (filterCell, true);
-			filterColumn.AddAttribute(filterCell, "active", 1);
-
-			tree.AppendColumn (nameColumn);
-			tree.AppendColumn (filterColumn);
-		}
-
-		private void FillTree () {
+		protected override void FillTree () {
 			TreeStore store = new TreeStore (typeof (Player), typeof (bool));
 			localIter = store.AppendValues (localTeam);
 			visitorIter = store.AppendValues (visitorTeam);
@@ -82,55 +64,60 @@ namespace LongoMatch.Gui.Component
 			foreach (Player player in visitor.PlayingPlayersList) {
 				store.AppendValues (visitorIter, player, filter.VisiblePlayers.Contains(player));
 			}
-			tree.Model = store;
+			Model = store;
 		}
  
-		void HandleFilterCellToggled (object o, ToggledArgs args)
+		protected override void HandleFilterCellToggled (object o, ToggledArgs args)
 		{
 			Gtk.TreeIter iter;
-			TreeStore store = tree.Model as TreeStore;
+			TreeStore store = Model as TreeStore;
 			
 			if (store.GetIterFromString(out iter, args.Path))
 			{
-				Player player = (Player) store.GetValue(iter, 0);
 				bool active = !((bool) store.GetValue(iter, 1));
+				UpdateSelection(iter, active);
+			}
+		}
+		
+		void UpdateSelection(TreeIter iter, bool active) {
+			TreeStore store = Model as TreeStore;
+			Player player = (Player) store.GetValue(iter, 0);
+			
+			/* Check all children */
+			if (player == localTeam || player == visitorTeam)
+			{
+				TreeIter child;
+				store.IterChildren(out child, iter);
 				
-				/* Check all children */
-				if (player == localTeam || player == visitorTeam)
-				{
-					TreeIter child;
-					store.IterChildren(out child, iter);
-					
-					while (store.IterIsValid(child)) {
-						Player childPlayer = (Player) store.GetValue(child, 0);
-						if (active)
-							filter.UnFilterPlayer(childPlayer);
-						else
-							filter.FilterPlayer(childPlayer);
-						store.SetValue(child, 1, active);
-						store.IterNext(ref child);
-					}
+				while (store.IterIsValid(child)) {
+					Player childPlayer = (Player) store.GetValue(child, 0);
+					if (active)
+						filter.UnFilterPlayer(childPlayer);
+					else
+						filter.FilterPlayer(childPlayer);
+					store.SetValue(child, 1, active);
+					store.IterNext(ref child);
+				}
+			} else {
+				if (active) {
+					filter.UnFilterPlayer(player);
 				} else {
-					if (active) {
-						filter.UnFilterPlayer(player);
-					} else {
-						TreeIter team;
-						filter.FilterPlayer(player);
-						/* Uncheck the team check button */
-						if (local.Contains(player))
-							team = localIter;
-						else
-							team = visitorIter;
-						store.SetValue(team, 1, false);
-					}
+					TreeIter team;
+					filter.FilterPlayer(player);
+					/* Uncheck the team check button */
+					if (local.Contains(player))
+						team = localIter;
+					else
+						team = visitorIter;
+					store.SetValue(team, 1, false);
 				}
-			
-				store.SetValue(iter, 1, active);
-				filter.Update();
 			}
+			
+			store.SetValue(iter, 1, active);
+			filter.Update();
 		}
 		
-		private void RenderPlayer (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+		protected override void RenderColumn (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
 		{
 			Player player = (Player) model.GetValue (iter, 0);
 			string name = player.ToString();
@@ -139,6 +126,12 @@ namespace LongoMatch.Gui.Component
 			}
 			(cell as CellRendererText).Text = name;
 		}
+		
+		
+		protected override void Select(bool select_all) {
+			UpdateSelection(localIter, select_all);
+			UpdateSelection(visitorIter, select_all);
+		}
 	}
 }
 
diff --git a/LongoMatch.GUI/LongoMatch.GUI.mdp b/LongoMatch.GUI/LongoMatch.GUI.mdp
index 899723f..ba39bd7 100644
--- a/LongoMatch.GUI/LongoMatch.GUI.mdp
+++ b/LongoMatch.GUI/LongoMatch.GUI.mdp
@@ -151,11 +151,10 @@
     <File subtype="Code" buildaction="Compile" name="Gui/Component/PlayersTagger.cs" />
     <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.PlayersTagger.cs" />
     <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs" />
-    <File subtype="Code" buildaction="Compile" name="Gui/Component/PlayersFilter.cs" />
-    <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.PlayersFilter.cs" />
-    <File subtype="Code" buildaction="Compile" name="Gui/Component/CategoriesFilter.cs" />
-    <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.CategoriesFilter.cs" />
     <File subtype="Code" buildaction="Compile" name="Gui/Component/PlaysSelectionWidget.cs" />
+    <File subtype="Code" buildaction="Compile" name="Gui/TreeView/PlayersFilterTreeView.cs" />
+    <File subtype="Code" buildaction="Compile" name="Gui/TreeView/FilterBaseView.cs" />
+    <File subtype="Code" buildaction="Compile" name="Gui/TreeView/CategoriesFilterTreeView.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
diff --git a/LongoMatch.GUI/Makefile.am b/LongoMatch.GUI/Makefile.am
index be79d05..1665601 100644
--- a/LongoMatch.GUI/Makefile.am
+++ b/LongoMatch.GUI/Makefile.am
@@ -17,6 +17,7 @@ SOURCES = \
 	gtk-gui/LongoMatch.Gui.Component.NotesWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayerProperties.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayersListTreeWidget.cs \
+	gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayersTaggerWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayersTagger.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayListWidget.cs \
@@ -26,7 +27,6 @@ SOURCES = \
 	gtk-gui/LongoMatch.Gui.Component.RenderingStateBar.cs \
 	gtk-gui/LongoMatch.Gui.Component.StringTaggerWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.TaggerWidget.cs \
-	gtk-gui/LongoMatch.Gui.Component.TagsTreeWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.TeamTaggerWidget.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.DrawingTool.cs \
@@ -68,6 +68,7 @@ SOURCES = \
 	Gui/Component/NotesWidget.cs \
 	Gui/Component/PlayerProperties.cs \
 	Gui/Component/PlayersListTreeWidget.cs \
+	Gui/Component/PlaysSelectionWidget.cs \
 	Gui/Component/PlayersTaggerWidget.cs \
 	Gui/Component/PlayersTagger.cs \
 	Gui/Component/PlayListWidget.cs \
@@ -77,7 +78,6 @@ SOURCES = \
 	Gui/Component/RenderingStateBar.cs \
 	Gui/Component/StringTaggerWidget.cs \
 	Gui/Component/TaggerWidget.cs \
-	Gui/Component/TagsTreeWidget.cs \
 	Gui/Component/TeamTaggerWidget.cs \
 	Gui/Component/TeamTemplateEditor.cs \
 	Gui/Component/TimelineLabelsWidget.cs \
@@ -109,15 +109,17 @@ SOURCES = \
 	Gui/Popup/CalendarPopup.cs \
 	Gui/Popup/MessagePopup.cs \
 	Gui/TransparentDrawingArea.cs \
+	Gui/TreeView/CategoriesFilterTreeView.cs \
 	Gui/TreeView/CategoriesTreeView.cs \
+	Gui/TreeView/FilterBaseView.cs \
 	Gui/TreeView/ListTreeViewBase.cs \
+	Gui/TreeView/PlayersFilterTreeView.cs \
 	Gui/TreeView/PlayerPropertiesTreeView.cs \
 	Gui/TreeView/PlayersTreeView.cs \
 	Gui/TreeView/PlayListTreeView.cs \
 	Gui/TreeView/PlaysTreeView.cs \
 	Gui/TreeView/RenderingJobsTreeView.cs \
 	Gui/TreeView/SubCategoriesTreeView.cs \
-	Gui/TreeView/TagsTreeView.cs \
 	Gui/Cairo.cs \
 	Gui/GUIToolkit.cs \
 	Gui/Helpers.cs \
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
index 99a90f2..54a4ea2 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
@@ -11,10 +11,6 @@ namespace LongoMatch.Gui.Component
 		private global::Gtk.Label localPlaysList;
 		private global::LongoMatch.Gui.Component.PlayersListTreeWidget visitorPlayersList;
 		private global::Gtk.Label visitorPlaysList;
-		private global::LongoMatch.Gui.Component.PlayersFilter playersfilter;
-		private global::Gtk.Label label4;
-		private global::LongoMatch.Gui.Component.CategoriesFilter categoriesfilter;
-		private global::Gtk.Label label5;
 		
 		protected virtual void Build ()
 		{
@@ -26,7 +22,7 @@ namespace LongoMatch.Gui.Component
 			this.notebook1 = new global::Gtk.Notebook ();
 			this.notebook1.CanFocus = true;
 			this.notebook1.Name = "notebook1";
-			this.notebook1.CurrentPage = 4;
+			this.notebook1.CurrentPage = 2;
 			this.notebook1.TabPos = ((global::Gtk.PositionType)(3));
 			// Container child notebook1.Gtk.Notebook+NotebookChild
 			this.playsList = new global::LongoMatch.Gui.Component.PlaysListTreeWidget ();
@@ -63,32 +59,6 @@ namespace LongoMatch.Gui.Component
 			this.visitorPlaysList.Name = "visitorPlaysList";
 			this.notebook1.SetTabLabel (this.visitorPlayersList, this.visitorPlaysList);
 			this.visitorPlaysList.ShowAll ();
-			// Container child notebook1.Gtk.Notebook+NotebookChild
-			this.playersfilter = new global::LongoMatch.Gui.Component.PlayersFilter ();
-			this.playersfilter.Events = ((global::Gdk.EventMask)(256));
-			this.playersfilter.Name = "playersfilter";
-			this.notebook1.Add (this.playersfilter);
-			global::Gtk.Notebook.NotebookChild w4 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.playersfilter]));
-			w4.Position = 3;
-			// Notebook tab
-			this.label4 = new global::Gtk.Label ();
-			this.label4.Name = "label4";
-			this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Players filter");
-			this.notebook1.SetTabLabel (this.playersfilter, this.label4);
-			this.label4.ShowAll ();
-			// Container child notebook1.Gtk.Notebook+NotebookChild
-			this.categoriesfilter = new global::LongoMatch.Gui.Component.CategoriesFilter ();
-			this.categoriesfilter.Events = ((global::Gdk.EventMask)(256));
-			this.categoriesfilter.Name = "categoriesfilter";
-			this.notebook1.Add (this.categoriesfilter);
-			global::Gtk.Notebook.NotebookChild w5 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.categoriesfilter]));
-			w5.Position = 4;
-			// Notebook tab
-			this.label5 = new global::Gtk.Label ();
-			this.label5.Name = "label5";
-			this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Categories filter");
-			this.notebook1.SetTabLabel (this.categoriesfilter, this.label5);
-			this.label5.ShowAll ();
 			this.Add (this.notebook1);
 			if ((this.Child != null)) {
 				this.Child.ShowAll ();
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.Win32CalendarDialog.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.Win32CalendarDialog.cs
index 4ac3565..78e6620 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.Win32CalendarDialog.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.Win32CalendarDialog.cs
@@ -51,8 +51,8 @@ namespace LongoMatch.Gui.Dialog
 			if ((this.Child != null)) {
 				this.Child.ShowAll ();
 			}
-			this.DefaultWidth = 219;
-			this.DefaultHeight = 225;
+			this.DefaultWidth = 259;
+			this.DefaultHeight = 258;
 			this.Show ();
 			this.calendar1.DaySelectedDoubleClick += new global::System.EventHandler (this.OnCalendar1DaySelectedDoubleClick);
 			this.calendar1.DaySelected += new global::System.EventHandler (this.OnCalendar1DaySelected);
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 09ca5ce..72d0dc4 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -140,7 +140,7 @@ namespace LongoMatch.Gui
 			this.ManualTaggingViewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Free Capture Mode");
 			w1.Add (this.ManualTaggingViewAction, "<Control>f");
 			this.GameUnitsViewAction = new global::Gtk.RadioAction ("GameUnitsViewAction", global::Mono.Unix.Catalog.GetString ("Game units view"), null, null, 0);
-			this.GameUnitsViewAction.Group = this.ManualTaggingViewAction.Group;
+			this.GameUnitsViewAction.Group = this.TimelineViewAction.Group;
 			this.GameUnitsViewAction.Sensitive = false;
 			this.GameUnitsViewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Game units view");
 			w1.Add (this.GameUnitsViewAction, null);
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index df5ee45..bb93bf4 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -4352,7 +4352,7 @@ No</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.Win32CalendarDialog" design-size="219 225">
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.Win32CalendarDialog" design-size="259 258">
     <property name="MemberName" />
     <property name="Title" translatable="yes">Calendar</property>
     <property name="Icon">stock:longomatch Menu</property>
@@ -4427,7 +4427,7 @@ No</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DrawingToolBox" design-size="94 398">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DrawingToolBox" design-size="94 430">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
@@ -4460,6 +4460,7 @@ No</property>
                 <property name="MemberName" />
                 <property name="CanFocus">True</property>
                 <property name="Label" translatable="yes" />
+                <property name="Active">True</property>
                 <property name="DrawIndicator">False</property>
                 <property name="HasLabel">False</property>
                 <property name="UseUnderline">True</property>
@@ -6670,14 +6671,14 @@ Defining &lt;b&gt; Game Units &lt;/b&gt; will help you during the analysis to in
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlaysSelectionWidget" design-size="355 495">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlaysSelectionWidget" design-size="568 495">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
       <widget class="Gtk.Notebook" id="notebook1">
         <property name="MemberName" />
         <property name="CanFocus">True</property>
-        <property name="CurrentPage">4</property>
+        <property name="CurrentPage">2</property>
         <property name="TabPos">Bottom</property>
         <child>
           <widget class="LongoMatch.Gui.Component.PlaysListTreeWidget" id="playsList">
@@ -6728,74 +6729,7 @@ Defining &lt;b&gt; Game Units &lt;/b&gt; will help you during the analysis to in
             <property name="type">tab</property>
           </packing>
         </child>
-        <child>
-          <widget class="LongoMatch.Gui.Component.PlayersFilter" id="playersfilter">
-            <property name="MemberName" />
-            <property name="Events">ButtonPressMask</property>
-          </widget>
-          <packing>
-            <property name="Position">3</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="Gtk.Label" id="label4">
-            <property name="MemberName" />
-            <property name="LabelProp" translatable="yes">Players filter</property>
-          </widget>
-          <packing>
-            <property name="type">tab</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="LongoMatch.Gui.Component.CategoriesFilter" id="categoriesfilter">
-            <property name="MemberName" />
-            <property name="Events">ButtonPressMask</property>
-          </widget>
-          <packing>
-            <property name="Position">4</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="Gtk.Label" id="label5">
-            <property name="MemberName" />
-            <property name="LabelProp" translatable="yes">Categories filter</property>
-          </widget>
-          <packing>
-            <property name="type">tab</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlayersFilter" design-size="300 300">
-    <property name="MemberName" />
-    <property name="Visible">False</property>
-    <child>
-      <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
-        <property name="MemberName" />
-        <property name="ShadowType">In</property>
-        <child>
-          <widget class="Gtk.TreeView" id="tree">
-            <property name="MemberName" />
-            <property name="CanFocus">True</property>
-            <property name="ShowScrollbars">True</property>
-          </widget>
-        </child>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoriesFilter" design-size="300 300">
-    <property name="MemberName" />
-    <property name="Visible">False</property>
-    <child>
-      <placeholder />
-    </child>
-  </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoriesFilter" design-size="300 300">
-    <property name="MemberName" />
-    <property name="Visible">False</property>
-    <child>
-      <placeholder />
-    </child>
-  </widget>
 </stetic-interface>
\ No newline at end of file
diff --git a/LongoMatch.GUI/gtk-gui/objects.xml b/LongoMatch.GUI/gtk-gui/objects.xml
index 2f4493b..d542d55 100644
--- a/LongoMatch.GUI/gtk-gui/objects.xml
+++ b/LongoMatch.GUI/gtk-gui/objects.xml
@@ -84,19 +84,6 @@
       </itemgroup>
     </signals>
   </object>
-  <object type="LongoMatch.Gui.Component.DrawingToolBox" palette-category="General" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups />
-    <signals>
-      <itemgroup label="DrawingToolBox Signals">
-        <signal name="LineWidthChanged" />
-        <signal name="DrawToolChanged" />
-        <signal name="ColorChanged" />
-        <signal name="VisibilityChanged" />
-        <signal name="ClearDrawing" />
-        <signal name="TransparencyChanged" />
-      </itemgroup>
-    </signals>
-  </object>
   <object type="LongoMatch.Gui.Component.GameUnitsTagger" palette-category="General" allow-children="false" base-type="Gtk.Bin">
     <itemgroups />
     <signals>
@@ -128,6 +115,10 @@
   </object>
   <object type="LongoMatch.Gui.Base.TemplatesEditorWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
     <itemgroups>
+      <itemgroup label="TemplatesEditorBase Properties">
+        <property name="CanExport" />
+        <property name="Edited" />
+      </itemgroup>
     </itemgroups>
     <signals />
   </object>
@@ -270,20 +261,22 @@
       </itemgroup>
     </signals>
   </object>
-  <object type="LongoMatch.Gui.Component.PlayersFilter" palette-category="General" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups />
-    <signals />
-  </object>
-  <object type="LongoMatch.Gui.Component.CategoriesFilter" palette-category="General" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups />
-    <signals />
-  </object>
   <object type="LongoMatch.Gui.Component.TeamTemplateEditorWidget" palette-category="General" allow-children="false" base-type="LongoMatch.Gui.Base.TemplatesEditorBase">
-    <itemgroups />
+    <itemgroups>
+      <itemgroup label="TemplatesEditorBase Properties">
+        <property name="CanExport" />
+        <property name="Edited" />
+      </itemgroup>
+    </itemgroups>
     <signals />
   </object>
   <object type="LongoMatch.Gui.Component.CategoriesTemplateEditorWidget" palette-category="General" allow-children="false" base-type="LongoMatch.Gui.Base.TemplatesEditorBase">
-    <itemgroups />
+    <itemgroups>
+      <itemgroup label="TemplatesEditorBase Properties">
+        <property name="CanExport" />
+        <property name="Edited" />
+      </itemgroup>
+    </itemgroups>
     <signals />
   </object>
   <object type="LongoMatch.Gui.Component.TimeScale" palette-category="LongoMatch" allow-children="false" base-type="Gtk.DrawingArea">
@@ -339,4 +332,29 @@
       </itemgroup>
     </signals>
   </object>
+  <object type="LongoMatch.Gui.Component.CategoriesFilterTreeView" palette-category="LongoMatch" allow-children="false" base-type="Gtk.TreeView">
+    <itemgroups />
+    <signals />
+  </object>
+  <object type="LongoMatch.Gui.Component.FilterTreeViewBase" palette-category="LongoMatch" allow-children="false" base-type="Gtk.TreeView">
+    <itemgroups />
+    <signals />
+  </object>
+  <object type="LongoMatch.Gui.Component.PlayersFilterTreeView" palette-category="LongoMatch" allow-children="false" base-type="Gtk.TreeView">
+    <itemgroups />
+    <signals />
+  </object>
+  <object type="LongoMatch.Gui.Component.DrawingToolBox" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups />
+    <signals>
+      <itemgroup label="DrawingToolBox Signals">
+        <signal name="LineWidthChanged" />
+        <signal name="DrawToolChanged" />
+        <signal name="ColorChanged" />
+        <signal name="VisibilityChanged" />
+        <signal name="ClearDrawing" />
+        <signal name="TransparencyChanged" />
+      </itemgroup>
+    </signals>
+  </object>
 </objects>
\ No newline at end of file



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