[longomatch/gameunits: 12/12] Add Game Units and a way to edit them



commit b45a8edb88acfdc236b23c54d5b512903fb8f76e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Nov 11 02:13:53 2011 +0100

    Add Game Units and a way to edit them

 LongoMatch.Core/LongoMatch.Core.mdp                |    2 +
 LongoMatch.Core/Makefile.am                        |    2 +
 LongoMatch.Core/Store/GameUnit.cs                  |   43 ++
 LongoMatch.Core/Store/GameUnitsList.cs             |   61 +++
 .../Store/Templates/CategoriesTemplate.cs          |   18 +-
 .../Gui/Component/CategoriesTemplateEditor.cs      |   10 +-
 LongoMatch.GUI/Gui/Component/GameUnitsEditor.cs    |  114 +++++
 LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs |    2 +-
 .../Gui/Component/TemplatesEditorBase.cs           |   21 +-
 .../Gui/Component/TimeReferenceWidget.cs           |    2 +-
 LongoMatch.GUI/LongoMatch.GUI.mdp                  |    2 +
 LongoMatch.GUI/Makefile.am                         |    2 +
 .../LongoMatch.Gui.Component.GameUnitsEditor.cs    |  126 ++++++
 ...LongoMatch.Gui.Component.TemplatesEditorBase.cs |  222 ++++++-----
 LongoMatch.GUI/gtk-gui/gui.stetic                  |  431 ++++++++++++++------
 LongoMatch.GUI/gtk-gui/objects.xml                 |   56 ++--
 LongoMatch/LongoMatch.mdp                          |    6 +
 17 files changed, 856 insertions(+), 264 deletions(-)
---
diff --git a/LongoMatch.Core/LongoMatch.Core.mdp b/LongoMatch.Core/LongoMatch.Core.mdp
index 6a7a326..f79e37e 100644
--- a/LongoMatch.Core/LongoMatch.Core.mdp
+++ b/LongoMatch.Core/LongoMatch.Core.mdp
@@ -70,6 +70,8 @@
     <File subtype="Code" buildaction="Compile" name="Interfaces/ITemplatesService.cs" />
     <File subtype="Code" buildaction="Compile" name="Interfaces/IDatabase.cs" />
     <File subtype="Code" buildaction="Compile" name="Interfaces/IPlaylistWidget.cs" />
+    <File subtype="Code" buildaction="Compile" name="Store/GameUnit.cs" />
+    <File subtype="Code" buildaction="Compile" name="Store/GameUnitsList.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
diff --git a/LongoMatch.Core/Makefile.am b/LongoMatch.Core/Makefile.am
index a661dc6..c92e69d 100644
--- a/LongoMatch.Core/Makefile.am
+++ b/LongoMatch.Core/Makefile.am
@@ -31,6 +31,8 @@ SOURCES = \
 	Interfaces/ITemplatesService.cs \
 	Store/Category.cs \
 	Store/Drawing.cs \
+	Store/GameUnit.cs \
+	Store/GameUnitsList.cs \
 	Store/HotKey.cs \
 	Store/MediaFile.cs \
 	Store/PixbufTimeNode.cs \
diff --git a/LongoMatch.Core/Store/GameUnit.cs b/LongoMatch.Core/Store/GameUnit.cs
new file mode 100644
index 0000000..eaa9885
--- /dev/null
+++ b/LongoMatch.Core/Store/GameUnit.cs
@@ -0,0 +1,43 @@
+// 
+//  Copyright (C) 2011 andoni
+// 
+//  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 System.Collections.Generic;
+
+namespace LongoMatch.Store
+{
+	[Serializable]
+	public class GameUnit: List<TimeNode>
+	{
+		
+		public GameUnit (string name)
+		{
+			Name=name;
+		}
+		
+		public string Name {
+			get;
+			set;
+		}
+		
+		public override string ToString ()
+		{
+			return string.Format ("[GameUnit: Name={0}]", Name);
+		}	
+	}
+}
+
diff --git a/LongoMatch.Core/Store/GameUnitsList.cs b/LongoMatch.Core/Store/GameUnitsList.cs
new file mode 100644
index 0000000..65503e4
--- /dev/null
+++ b/LongoMatch.Core/Store/GameUnitsList.cs
@@ -0,0 +1,61 @@
+// 
+//  Copyright (C) 2011 andoni
+// 
+//  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 System.Collections.Generic;
+
+using LongoMatch.Store;
+
+namespace LongoMatch.Store
+{
+	[Serializable]
+	public class GameUnitsList: List<GameUnit>
+	{
+		public GameUnitsList ()
+		{
+		}
+		
+		public int GameUnitDepth(GameUnit gameUnit) {
+			return this.IndexOf(gameUnit);
+		}
+		
+		public GameUnit GetParent(GameUnit gameUnit) {
+			int index;
+			
+			if (!this.Contains(gameUnit))
+				return null;
+			
+			index = this.IndexOf(gameUnit);
+			if (index == 0)
+				return null;
+			return this[index-1];
+		}
+
+		public GameUnit GetChild(GameUnit gameUnit) {
+			int index;
+			
+			if (!this.Contains(gameUnit))
+				return null;
+			
+			index = this.IndexOf(gameUnit);
+			if (index == this.Count - 1)
+				return null;
+			return this[index+1];
+		}
+	}
+}
+
diff --git a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs b/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
index 7363683..dc8d73b 100644
--- a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
@@ -39,16 +39,32 @@ namespace LongoMatch.Store.Templates
 	[Serializable]
 	public class Categories: List<Category>, ITemplate, ITemplate<Category>
 	{
+		/* Database additions */
+		GameUnitsList gameUnits;
 
 		/// <summary>
 		/// Creates a new template
 		/// </summary>
-		public Categories() {}
+		public Categories() {
+		}
 
 		public string Name {
 			get;
 			set;
 		}
+		
+		public GameUnitsList GameUnits {
+			set {
+				gameUnits = value;
+			}
+			get {
+				if (gameUnits == null) {
+					gameUnits = new GameUnitsList();
+				}
+				return gameUnits;
+			}
+		}
+		
 		public void Save(string filePath) {
 			SerializableObject.Save(this, filePath);
 		}
diff --git a/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs b/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs
index 6589b3c..51ecccd 100644
--- a/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs
+++ b/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs
@@ -28,8 +28,9 @@ namespace LongoMatch.Gui.Component
 {
 	public class CategoriesTemplateEditorWidget: TemplatesEditorWidget<Categories, Category> 
 	{
-		private CategoriesTreeView categoriestreeview;
-		private List<HotKey> hkList;
+		CategoriesTreeView categoriestreeview;
+		List<HotKey> hkList;
+		GameUnitsEditor gameUnitsEditor;
 
 		public CategoriesTemplateEditorWidget (ITemplateProvider<Categories, Category> provider): base(provider)
 		{
@@ -37,7 +38,11 @@ namespace LongoMatch.Gui.Component
 			categoriestreeview = new CategoriesTreeView();
 			categoriestreeview.CategoryClicked += this.OnCategoryClicked;
 			categoriestreeview.CategoriesSelected += this.OnCategoriesSelected;
+			CurrentPage = 0;
+			FirstPageName = Catalog.GetString("Categories");
 			AddTreeView(categoriestreeview);
+			gameUnitsEditor = new GameUnitsEditor();
+			AddPage(gameUnitsEditor, "Game phases");
 		}
 		
 		public override Categories Template {
@@ -58,6 +63,7 @@ namespace LongoMatch.Gui.Component
 				}
 				categoriestreeview.Model = categoriesListStore;
 				ButtonsSensitive = false;
+				gameUnitsEditor.SetRootGameUnit(value.GameUnits);
 			}
 		}
 		
diff --git a/LongoMatch.GUI/Gui/Component/GameUnitsEditor.cs b/LongoMatch.GUI/Gui/Component/GameUnitsEditor.cs
new file mode 100644
index 0000000..ae1db8f
--- /dev/null
+++ b/LongoMatch.GUI/Gui/Component/GameUnitsEditor.cs
@@ -0,0 +1,114 @@
+// 
+//  Copyright (C) 2011 andoni
+// 
+//  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 System.Collections.Generic;
+using Gtk;
+
+using LongoMatch.Store;
+
+namespace LongoMatch.Gui.Component
+{
+	[System.ComponentModel.ToolboxItem(true)]
+	public partial class GameUnitsEditor : Gtk.Bin
+	{
+		
+		GameUnitsList gameUnits;
+		Dictionary<GameUnit, Widget> dict;
+		
+		public GameUnitsEditor ()
+		{
+			this.Build ();
+			dict = new Dictionary<GameUnit, Widget>();
+			entry1.Activated += OnAddGameUnit;
+			entry1.Changed += (sender, e) => {addbutton.Sensitive = entry1.Text != "";};
+			addbutton.Clicked += OnAddGameUnit;
+		}
+		
+		public void SetRootGameUnit (GameUnitsList gameUnits) {
+			/* Make everything visible */
+			vbox2.Visible = true;
+			
+			/* Clear everything first */
+			if (this.gameUnits != null) {
+				foreach (GameUnit gameUnit in this.gameUnits)
+					RemoveGameUnit(gameUnit, false);
+			}
+			this.gameUnits = gameUnits;
+			
+			/* Add the game units one by one */
+			foreach (GameUnit gameUnit in gameUnits) 
+				AddGameUnit(gameUnit, false);
+		}
+		
+		private void AddGameUnit (string name) {
+			if (name == "")
+				return;
+			AddGameUnit(new GameUnit(name), true);
+		}
+		
+		private void AddGameUnit (GameUnit gameUnit, bool append) {
+			HBox hbox;
+			Label label;
+			Button button;
+			
+			Log.Debug("Adding new game unit" + gameUnit);
+			label1.Hide();
+			outerbox.Visible = true;
+			
+			if (append)
+				gameUnits.Add(gameUnit);
+			
+			/* Create widget that display the game unit name and a button to remove it */
+			hbox = new HBox();
+			label = new Label(gameUnit.Name);
+			label.Justify = Justification.Left;
+			button = new Button("gtk-delete");
+			button.Clicked += (sender, e) => {RemoveGameUnitAndChildren(gameUnit);};
+			dict.Add(gameUnit, hbox);
+			
+			/* Pack everything */
+			hbox.PackStart(label, false, false, (uint)((gameUnits.GameUnitDepth(gameUnit) * 10) + 10));
+			hbox.PackEnd(button, false, false, 0);
+			label.Show();
+			button.Show();
+			hbox.Show();
+			phasesbox.PackStart(hbox, true, false, 0);
+		}
+		
+		private void RemoveGameUnit (GameUnit gameUnit, bool delete) {
+			phasesbox.Remove(dict[gameUnit]);
+			dict[gameUnit].Destroy();
+			dict.Remove(gameUnit);
+			if (delete)
+				gameUnits.Remove(gameUnit);
+		}
+		
+		private void RemoveGameUnitAndChildren (GameUnit gameUnit) {
+			int depth = gameUnits.GameUnitDepth(gameUnit);
+			
+			foreach (var g in gameUnits.GetRange(depth, gameUnits.Count - depth))
+				RemoveGameUnit(g, true);
+		}
+
+		protected void OnAddGameUnit (object sender, System.EventArgs e)
+		{
+			AddGameUnit(entry1.Text);
+			entry1.Text = "";
+		}
+	}
+}
diff --git a/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs b/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs
index 9476f02..54a42f4 100644
--- a/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs
+++ b/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs
@@ -41,9 +41,9 @@ namespace LongoMatch.Gui.Component
 			treeview = new PlayerPropertiesTreeView(); 
 			treeview.PlayerClicked += this.OnPlayerClicked;
 			treeview.PlayersSelected += this.OnPlayersSelected;
+			FirstPageName = Catalog.GetString("Teams players");
 			AddTreeView(treeview);
 			AddTeamNamesWidget();
-			
 		}
 		
 		public override  TeamTemplate Template {
diff --git a/LongoMatch.GUI/Gui/Component/TemplatesEditorBase.cs b/LongoMatch.GUI/Gui/Component/TemplatesEditorBase.cs
index de3aa76..2083393 100644
--- a/LongoMatch.GUI/Gui/Component/TemplatesEditorBase.cs
+++ b/LongoMatch.GUI/Gui/Component/TemplatesEditorBase.cs
@@ -59,8 +59,20 @@ namespace LongoMatch.Gui.Component
 			set;
 		}
 		
+		public int CurrentPage {
+			set {
+				notebook.CurrentPage = value;
+			}
+		}
+		
+		public string FirstPageName {
+			set {
+				(notebook.GetTabLabel(notebook.GetNthPage(0)) as Label).Text = value;
+			}
+		}
+		
 		protected void AddTreeView (Widget w) {
-			scrolledwindow2.Add(w);
+			scrolledwindow.Add(w);
 			w.Show();
 		}
 		
@@ -68,6 +80,13 @@ namespace LongoMatch.Gui.Component
 			upbox.PackStart(w, true, false, 0);
 		}
 		
+		protected void AddPage (Widget widget, string name) {
+			Label label = new Label(name);
+			widget.Show();
+			label.Show();
+			notebook.AppendPage(widget, label);
+		}
+		
 		protected bool ButtonsSensitive {
 			set {
 				newprevbutton.Sensitive = value;
diff --git a/LongoMatch.GUI/Gui/Component/TimeReferenceWidget.cs b/LongoMatch.GUI/Gui/Component/TimeReferenceWidget.cs
index 0b479bb..9cd46e8 100644
--- a/LongoMatch.GUI/Gui/Component/TimeReferenceWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/TimeReferenceWidget.cs
@@ -95,7 +95,7 @@ namespace LongoMatch.Gui.Component
 			win.GetSize(out width, out height);
 			win.Resize((int)(frames/pixelRatio), height);
 			win.GetSize(out width, out height);
-
+			
 			if(Environment.OSVersion.Platform == PlatformID.Unix)
 				this.CairoDraw(evnt,height,width);
 			else
diff --git a/LongoMatch.GUI/LongoMatch.GUI.mdp b/LongoMatch.GUI/LongoMatch.GUI.mdp
index 5051370..0f4fd83 100644
--- a/LongoMatch.GUI/LongoMatch.GUI.mdp
+++ b/LongoMatch.GUI/LongoMatch.GUI.mdp
@@ -137,6 +137,8 @@
     <File subtype="Code" buildaction="EmbedAsResource" name="../images/stock_draw-rectangle-unfilled.png" />
     <File subtype="Code" buildaction="EmbedAsResource" name="../images/video.png" />
     <File subtype="Code" buildaction="EmbedAsResource" name="../images/camera-video.png" />
+    <File subtype="Code" buildaction="Compile" name="Gui/Component/GameUnitsEditor.cs" />
+    <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Component.GameUnitsEditor.cs" />
   </Contents>
   <MonoDevelop.Autotools.MakefileInfo RelativeMakefileName="../CesarPlayer/Makefile.am" RelativeConfigureInPath="../">
     <BuildFilesVar Name="FILES" />
diff --git a/LongoMatch.GUI/Makefile.am b/LongoMatch.GUI/Makefile.am
index 17fff7f..30a807b 100644
--- a/LongoMatch.GUI/Makefile.am
+++ b/LongoMatch.GUI/Makefile.am
@@ -9,6 +9,7 @@ SOURCES = \
 	gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs \
 	gtk-gui/LongoMatch.Gui.Component.DrawingToolBox.cs \
 	gtk-gui/LongoMatch.Gui.Component.DrawingWidget.cs \
+	gtk-gui/LongoMatch.Gui.Component.GameUnitsEditor.cs \
 	gtk-gui/LongoMatch.Gui.Component.NotesWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayerProperties.cs \
 	gtk-gui/LongoMatch.Gui.Component.PlayersListTreeWidget.cs \
@@ -55,6 +56,7 @@ SOURCES = \
 	Gui/Component/CategoryProperties.cs \
 	Gui/Component/DrawingToolBox.cs \
 	Gui/Component/DrawingWidget.cs \
+	Gui/Component/GameUnitsEditor.cs \
 	Gui/Component/NotesWidget.cs \
 	Gui/Component/PlayerProperties.cs \
 	Gui/Component/PlayersListTreeWidget.cs \
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.GameUnitsEditor.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.GameUnitsEditor.cs
new file mode 100644
index 0000000..c533843
--- /dev/null
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.GameUnitsEditor.cs
@@ -0,0 +1,126 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Component
+{
+	public partial class GameUnitsEditor
+	{
+		private global::Gtk.VBox vbox2;
+		private global::Gtk.Label label1;
+		private global::Gtk.ScrolledWindow scrolledwindow2;
+		private global::Gtk.VBox outerbox;
+		private global::Gtk.VBox phasesbox;
+		private global::Gtk.VBox fillerbox;
+		private global::Gtk.HBox hbox1;
+		private global::Gtk.Entry entry1;
+		private global::Gtk.Button addbutton;
+        
+		protected virtual void Build ()
+		{
+			global::Stetic.Gui.Initialize (this);
+			// Widget LongoMatch.Gui.Component.GameUnitsEditor
+			global::Stetic.BinContainer.Attach (this);
+			this.Name = "LongoMatch.Gui.Component.GameUnitsEditor";
+			// Container child LongoMatch.Gui.Component.GameUnitsEditor.Gtk.Container+ContainerChild
+			this.vbox2 = new global::Gtk.VBox ();
+			this.vbox2.Name = "vbox2";
+			this.vbox2.Spacing = 6;
+			// Container child vbox2.Gtk.Box+BoxChild
+			this.label1 = new global::Gtk.Label ();
+			this.label1.Name = "label1";
+			this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Game Units</b>: Games are usually divided in time by units. In sports like field hockey the game is divided in 2 halves but other sports like tenis have several types of units that are anidated, e.g. Set->Game->Point.\n\nDefining <b> Game Units </b> will help you during the analysis to indentify the tagged plays in the the phases of the game.");
+			this.label1.UseMarkup = true;
+			this.label1.Wrap = true;
+			this.label1.WidthChars = 70;
+			this.vbox2.Add (this.label1);
+			global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1]));
+			w1.Position = 0;
+			w1.Expand = false;
+			w1.Fill = false;
+			// Container child vbox2.Gtk.Box+BoxChild
+			this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
+			this.scrolledwindow2.CanFocus = true;
+			this.scrolledwindow2.Name = "scrolledwindow2";
+			this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
+			// Container child scrolledwindow2.Gtk.Container+ContainerChild
+			global::Gtk.Viewport w2 = new global::Gtk.Viewport ();
+			w2.ShadowType = ((global::Gtk.ShadowType)(0));
+			// Container child GtkViewport.Gtk.Container+ContainerChild
+			this.outerbox = new global::Gtk.VBox ();
+			this.outerbox.Name = "outerbox";
+			this.outerbox.Spacing = 6;
+			// Container child outerbox.Gtk.Box+BoxChild
+			this.phasesbox = new global::Gtk.VBox ();
+			this.phasesbox.Name = "phasesbox";
+			this.phasesbox.Spacing = 6;
+			this.outerbox.Add (this.phasesbox);
+			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.outerbox [this.phasesbox]));
+			w3.Position = 0;
+			w3.Expand = false;
+			// Container child outerbox.Gtk.Box+BoxChild
+			this.fillerbox = new global::Gtk.VBox ();
+			this.fillerbox.Name = "fillerbox";
+			this.fillerbox.Spacing = 6;
+			this.outerbox.Add (this.fillerbox);
+			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.outerbox [this.fillerbox]));
+			w4.Position = 1;
+			w2.Add (this.outerbox);
+			this.scrolledwindow2.Add (w2);
+			this.vbox2.Add (this.scrolledwindow2);
+			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow2]));
+			w7.Position = 1;
+			// Container child vbox2.Gtk.Box+BoxChild
+			this.hbox1 = new global::Gtk.HBox ();
+			this.hbox1.Name = "hbox1";
+			this.hbox1.Spacing = 6;
+			// Container child hbox1.Gtk.Box+BoxChild
+			this.entry1 = new global::Gtk.Entry ();
+			this.entry1.CanFocus = true;
+			this.entry1.Name = "entry1";
+			this.entry1.IsEditable = true;
+			this.entry1.InvisibleChar = 'â';
+			this.hbox1.Add (this.entry1);
+			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entry1]));
+			w8.Position = 0;
+			// Container child hbox1.Gtk.Box+BoxChild
+			this.addbutton = new global::Gtk.Button ();
+			this.addbutton.Sensitive = false;
+			this.addbutton.CanFocus = true;
+			this.addbutton.Name = "addbutton";
+			this.addbutton.UseUnderline = true;
+			// Container child addbutton.Gtk.Container+ContainerChild
+			global::Gtk.Alignment w9 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+			// Container child GtkAlignment.Gtk.Container+ContainerChild
+			global::Gtk.HBox w10 = new global::Gtk.HBox ();
+			w10.Spacing = 2;
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Image w11 = new global::Gtk.Image ();
+			w11.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Dialog);
+			w10.Add (w11);
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Label w13 = new global::Gtk.Label ();
+			w13.LabelProp = global::Mono.Unix.Catalog.GetString ("Add game unit");
+			w13.UseUnderline = true;
+			w10.Add (w13);
+			w9.Add (w10);
+			this.addbutton.Add (w9);
+			this.hbox1.Add (this.addbutton);
+			global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.addbutton]));
+			w17.Position = 1;
+			w17.Expand = false;
+			w17.Fill = false;
+			this.vbox2.Add (this.hbox1);
+			global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
+			w18.PackType = ((global::Gtk.PackType)(1));
+			w18.Position = 2;
+			w18.Expand = false;
+			w18.Fill = false;
+			this.Add (this.vbox2);
+			if ((this.Child != null)) {
+				this.Child.ShowAll ();
+			}
+			this.outerbox.Hide ();
+			this.vbox2.Hide ();
+			this.Hide ();
+		}
+	}
+}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs
index ea969d6..789cb15 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs
@@ -4,9 +4,11 @@ namespace LongoMatch.Gui.Component
 {
 	public partial class TemplatesEditorBase
 	{
+		private global::Gtk.Notebook notebook;
 		private global::Gtk.HBox hbox1;
 		private global::Gtk.VBox mainbox;
 		private global::Gtk.ScrolledWindow scrolledwindow2;
+		private global::Gtk.ScrolledWindow scrolledwindow;
 		private global::Gtk.VBox vbox2;
 		private global::Gtk.VBox upbox;
 		private global::Gtk.Button newprevbutton;
@@ -15,6 +17,7 @@ namespace LongoMatch.Gui.Component
 		private global::Gtk.Button editbutton;
 		private global::Gtk.Button exportbutton;
 		private global::Gtk.HSeparator hseparator1;
+		private global::Gtk.Label label1;
         
 		protected virtual void Build ()
 		{
@@ -24,6 +27,11 @@ namespace LongoMatch.Gui.Component
 			this.WidthRequest = 400;
 			this.Name = "LongoMatch.Gui.Component.TemplatesEditorBase";
 			// Container child LongoMatch.Gui.Component.TemplatesEditorBase.Gtk.Container+ContainerChild
+			this.notebook = new global::Gtk.Notebook ();
+			this.notebook.CanFocus = true;
+			this.notebook.Name = "notebook";
+			this.notebook.CurrentPage = 0;
+			// Container child notebook.Gtk.Notebook+NotebookChild
 			this.hbox1 = new global::Gtk.HBox ();
 			this.hbox1.Name = "hbox1";
 			this.hbox1.Spacing = 6;
@@ -36,12 +44,22 @@ namespace LongoMatch.Gui.Component
 			this.scrolledwindow2.CanFocus = true;
 			this.scrolledwindow2.Name = "scrolledwindow2";
 			this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
+			// Container child scrolledwindow2.Gtk.Container+ContainerChild
+			global::Gtk.Viewport w1 = new global::Gtk.Viewport ();
+			w1.ShadowType = ((global::Gtk.ShadowType)(0));
+			// Container child GtkViewport.Gtk.Container+ContainerChild
+			this.scrolledwindow = new global::Gtk.ScrolledWindow ();
+			this.scrolledwindow.CanFocus = true;
+			this.scrolledwindow.Name = "scrolledwindow";
+			this.scrolledwindow.ShadowType = ((global::Gtk.ShadowType)(1));
+			w1.Add (this.scrolledwindow);
+			this.scrolledwindow2.Add (w1);
 			this.mainbox.Add (this.scrolledwindow2);
-			global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.mainbox [this.scrolledwindow2]));
-			w1.Position = 0;
+			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.mainbox [this.scrolledwindow2]));
+			w4.Position = 0;
 			this.hbox1.Add (this.mainbox);
-			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.mainbox]));
-			w2.Position = 0;
+			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.mainbox]));
+			w5.Position = 0;
 			// Container child hbox1.Gtk.Box+BoxChild
 			this.vbox2 = new global::Gtk.VBox ();
 			this.vbox2.Name = "vbox2";
@@ -51,10 +69,10 @@ namespace LongoMatch.Gui.Component
 			this.upbox.Name = "upbox";
 			this.upbox.Spacing = 6;
 			this.vbox2.Add (this.upbox);
-			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.upbox]));
-			w3.Position = 0;
-			w3.Expand = false;
-			w3.Fill = false;
+			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.upbox]));
+			w6.Position = 0;
+			w6.Expand = false;
+			w6.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.newprevbutton = new global::Gtk.Button ();
 			this.newprevbutton.TooltipMarkup = "Insert a new category before the selected one";
@@ -63,26 +81,26 @@ namespace LongoMatch.Gui.Component
 			this.newprevbutton.Name = "newprevbutton";
 			this.newprevbutton.UseUnderline = true;
 			// Container child newprevbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w4 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+			global::Gtk.Alignment w7 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w5 = new global::Gtk.HBox ();
-			w5.Spacing = 2;
+			global::Gtk.HBox w8 = new global::Gtk.HBox ();
+			w8.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w6 = new global::Gtk.Image ();
-			w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-top", global::Gtk.IconSize.Menu);
-			w5.Add (w6);
+			global::Gtk.Image w9 = new global::Gtk.Image ();
+			w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-top", global::Gtk.IconSize.Menu);
+			w8.Add (w9);
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w8 = new global::Gtk.Label ();
-			w8.LabelProp = global::Mono.Unix.Catalog.GetString ("New Before");
-			w8.UseUnderline = true;
-			w5.Add (w8);
-			w4.Add (w5);
-			this.newprevbutton.Add (w4);
+			global::Gtk.Label w11 = new global::Gtk.Label ();
+			w11.LabelProp = global::Mono.Unix.Catalog.GetString ("New Before");
+			w11.UseUnderline = true;
+			w8.Add (w11);
+			w7.Add (w8);
+			this.newprevbutton.Add (w7);
 			this.vbox2.Add (this.newprevbutton);
-			global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.newprevbutton]));
-			w12.Position = 1;
-			w12.Expand = false;
-			w12.Fill = false;
+			global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.newprevbutton]));
+			w15.Position = 1;
+			w15.Expand = false;
+			w15.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.newafterbutton = new global::Gtk.Button ();
 			this.newafterbutton.TooltipMarkup = "Insert a new category after the selected one";
@@ -91,26 +109,26 @@ namespace LongoMatch.Gui.Component
 			this.newafterbutton.Name = "newafterbutton";
 			this.newafterbutton.UseUnderline = true;
 			// Container child newafterbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w13 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+			global::Gtk.Alignment w16 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w14 = new global::Gtk.HBox ();
-			w14.Spacing = 2;
+			global::Gtk.HBox w17 = new global::Gtk.HBox ();
+			w17.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w15 = new global::Gtk.Image ();
-			w15.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-bottom", global::Gtk.IconSize.Menu);
-			w14.Add (w15);
+			global::Gtk.Image w18 = new global::Gtk.Image ();
+			w18.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-bottom", global::Gtk.IconSize.Menu);
+			w17.Add (w18);
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w17 = new global::Gtk.Label ();
-			w17.LabelProp = global::Mono.Unix.Catalog.GetString ("New After");
-			w17.UseUnderline = true;
-			w14.Add (w17);
-			w13.Add (w14);
-			this.newafterbutton.Add (w13);
+			global::Gtk.Label w20 = new global::Gtk.Label ();
+			w20.LabelProp = global::Mono.Unix.Catalog.GetString ("New After");
+			w20.UseUnderline = true;
+			w17.Add (w20);
+			w16.Add (w17);
+			this.newafterbutton.Add (w16);
 			this.vbox2.Add (this.newafterbutton);
-			global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.newafterbutton]));
-			w21.Position = 2;
-			w21.Expand = false;
-			w21.Fill = false;
+			global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.newafterbutton]));
+			w24.Position = 2;
+			w24.Expand = false;
+			w24.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.removebutton = new global::Gtk.Button ();
 			this.removebutton.TooltipMarkup = "Remove the selected category";
@@ -119,26 +137,26 @@ namespace LongoMatch.Gui.Component
 			this.removebutton.Name = "removebutton";
 			this.removebutton.UseUnderline = true;
 			// Container child removebutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w22 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+			global::Gtk.Alignment w25 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w23 = new global::Gtk.HBox ();
-			w23.Spacing = 2;
+			global::Gtk.HBox w26 = new global::Gtk.HBox ();
+			w26.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w24 = new global::Gtk.Image ();
-			w24.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu);
-			w23.Add (w24);
+			global::Gtk.Image w27 = new global::Gtk.Image ();
+			w27.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu);
+			w26.Add (w27);
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w26 = new global::Gtk.Label ();
-			w26.LabelProp = global::Mono.Unix.Catalog.GetString ("Remove");
-			w26.UseUnderline = true;
-			w23.Add (w26);
-			w22.Add (w23);
-			this.removebutton.Add (w22);
+			global::Gtk.Label w29 = new global::Gtk.Label ();
+			w29.LabelProp = global::Mono.Unix.Catalog.GetString ("Remove");
+			w29.UseUnderline = true;
+			w26.Add (w29);
+			w25.Add (w26);
+			this.removebutton.Add (w25);
 			this.vbox2.Add (this.removebutton);
-			global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.removebutton]));
-			w30.Position = 3;
-			w30.Expand = false;
-			w30.Fill = false;
+			global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.removebutton]));
+			w33.Position = 3;
+			w33.Expand = false;
+			w33.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.editbutton = new global::Gtk.Button ();
 			this.editbutton.TooltipMarkup = "Edit the selected category";
@@ -147,26 +165,26 @@ namespace LongoMatch.Gui.Component
 			this.editbutton.Name = "editbutton";
 			this.editbutton.UseUnderline = true;
 			// Container child editbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w31 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+			global::Gtk.Alignment w34 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w32 = new global::Gtk.HBox ();
-			w32.Spacing = 2;
+			global::Gtk.HBox w35 = new global::Gtk.HBox ();
+			w35.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w33 = new global::Gtk.Image ();
-			w33.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-edit", global::Gtk.IconSize.Menu);
-			w32.Add (w33);
+			global::Gtk.Image w36 = new global::Gtk.Image ();
+			w36.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-edit", global::Gtk.IconSize.Menu);
+			w35.Add (w36);
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w35 = new global::Gtk.Label ();
-			w35.LabelProp = global::Mono.Unix.Catalog.GetString ("Edit");
-			w35.UseUnderline = true;
-			w32.Add (w35);
-			w31.Add (w32);
-			this.editbutton.Add (w31);
+			global::Gtk.Label w38 = new global::Gtk.Label ();
+			w38.LabelProp = global::Mono.Unix.Catalog.GetString ("Edit");
+			w38.UseUnderline = true;
+			w35.Add (w38);
+			w34.Add (w35);
+			this.editbutton.Add (w34);
 			this.vbox2.Add (this.editbutton);
-			global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.editbutton]));
-			w39.Position = 4;
-			w39.Expand = false;
-			w39.Fill = false;
+			global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.editbutton]));
+			w42.Position = 4;
+			w42.Expand = false;
+			w42.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.exportbutton = new global::Gtk.Button ();
 			this.exportbutton.TooltipMarkup = "Export the template to a file";
@@ -174,42 +192,48 @@ namespace LongoMatch.Gui.Component
 			this.exportbutton.Name = "exportbutton";
 			this.exportbutton.UseUnderline = true;
 			// Container child exportbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w40 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+			global::Gtk.Alignment w43 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w41 = new global::Gtk.HBox ();
-			w41.Spacing = 2;
+			global::Gtk.HBox w44 = new global::Gtk.HBox ();
+			w44.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w42 = new global::Gtk.Image ();
-			w42.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save-as", global::Gtk.IconSize.Menu);
-			w41.Add (w42);
+			global::Gtk.Image w45 = new global::Gtk.Image ();
+			w45.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save-as", global::Gtk.IconSize.Menu);
+			w44.Add (w45);
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w44 = new global::Gtk.Label ();
-			w44.LabelProp = global::Mono.Unix.Catalog.GetString ("Export");
-			w44.UseUnderline = true;
-			w41.Add (w44);
-			w40.Add (w41);
-			this.exportbutton.Add (w40);
+			global::Gtk.Label w47 = new global::Gtk.Label ();
+			w47.LabelProp = global::Mono.Unix.Catalog.GetString ("Export");
+			w47.UseUnderline = true;
+			w44.Add (w47);
+			w43.Add (w44);
+			this.exportbutton.Add (w43);
 			this.vbox2.Add (this.exportbutton);
-			global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.exportbutton]));
-			w48.PackType = ((global::Gtk.PackType)(1));
-			w48.Position = 5;
-			w48.Expand = false;
-			w48.Fill = false;
+			global::Gtk.Box.BoxChild w51 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.exportbutton]));
+			w51.PackType = ((global::Gtk.PackType)(1));
+			w51.Position = 5;
+			w51.Expand = false;
+			w51.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.hseparator1 = new global::Gtk.HSeparator ();
 			this.hseparator1.Name = "hseparator1";
 			this.vbox2.Add (this.hseparator1);
-			global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hseparator1]));
-			w49.PackType = ((global::Gtk.PackType)(1));
-			w49.Position = 6;
-			w49.Expand = false;
-			w49.Fill = false;
+			global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hseparator1]));
+			w52.PackType = ((global::Gtk.PackType)(1));
+			w52.Position = 6;
+			w52.Expand = false;
+			w52.Fill = false;
 			this.hbox1.Add (this.vbox2);
-			global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2]));
-			w50.Position = 1;
-			w50.Expand = false;
-			w50.Fill = false;
-			this.Add (this.hbox1);
+			global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2]));
+			w53.Position = 1;
+			w53.Expand = false;
+			w53.Fill = false;
+			this.notebook.Add (this.hbox1);
+			// Notebook tab
+			this.label1 = new global::Gtk.Label ();
+			this.label1.Name = "label1";
+			this.notebook.SetTabLabel (this.hbox1, this.label1);
+			this.label1.ShowAll ();
+			this.Add (this.notebook);
 			if ((this.Child != null)) {
 				this.Child.ShowAll ();
 			}
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 2745485..c83ad97 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -1386,26 +1386,50 @@
     <property name="WidthRequest">400</property>
     <signal name="KeyPressEvent" handler="OnKeyPressEvent" />
     <child>
-      <widget class="Gtk.HBox" id="hbox1">
+      <widget class="Gtk.Notebook" id="notebook">
         <property name="MemberName" />
-        <property name="Spacing">6</property>
+        <property name="CanFocus">True</property>
+        <property name="CurrentPage">0</property>
         <child>
-          <widget class="Gtk.VBox" id="mainbox">
+          <widget class="Gtk.HBox" id="hbox1">
             <property name="MemberName" />
             <property name="Spacing">6</property>
             <child>
-              <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
+              <widget class="Gtk.VBox" id="mainbox">
                 <property name="MemberName" />
-                <property name="CanFocus">True</property>
-                <property name="ShadowType">In</property>
+                <property name="Spacing">6</property>
                 <child>
-                  <widget class="Gtk.Viewport" id="GtkViewport">
+                  <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
                     <property name="MemberName" />
-                    <property name="ShadowType">None</property>
+                    <property name="CanFocus">True</property>
+                    <property name="ShadowType">In</property>
                     <child>
-                      <placeholder />
+                      <widget class="Gtk.Viewport" id="GtkViewport">
+                        <property name="MemberName" />
+                        <property name="ShadowType">None</property>
+                        <child>
+                          <widget class="Gtk.ScrolledWindow" id="scrolledwindow">
+                            <property name="MemberName" />
+                            <property name="CanFocus">True</property>
+                            <property name="ShadowType">In</property>
+                            <child>
+                              <widget class="Gtk.Viewport" id="GtkViewport1">
+                                <property name="MemberName" />
+                                <property name="ShadowType">None</property>
+                                <child>
+                                  <placeholder />
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
                     </child>
                   </widget>
+                  <packing>
+                    <property name="Position">0</property>
+                    <property name="AutoSize">True</property>
+                  </packing>
                 </child>
               </widget>
               <packing>
@@ -1413,42 +1437,135 @@
                 <property name="AutoSize">True</property>
               </packing>
             </child>
-          </widget>
-          <packing>
-            <property name="Position">0</property>
-            <property name="AutoSize">True</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="Gtk.VBox" id="vbox2">
-            <property name="MemberName" />
-            <property name="Spacing">6</property>
             <child>
-              <widget class="Gtk.VBox" id="upbox">
+              <widget class="Gtk.VBox" id="vbox2">
                 <property name="MemberName" />
                 <property name="Spacing">6</property>
                 <child>
-                  <placeholder />
+                  <widget class="Gtk.VBox" id="upbox">
+                    <property name="MemberName" />
+                    <property name="Spacing">6</property>
+                    <child>
+                      <placeholder />
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="Position">0</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="newprevbutton">
+                    <property name="MemberName" />
+                    <property name="Sensitive">False</property>
+                    <property name="Tooltip" translatable="yes">Insert a new category before the selected one</property>
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-goto-top Menu</property>
+                    <property name="Label" translatable="yes">New Before</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnNewBefore" />
+                  </widget>
+                  <packing>
+                    <property name="Position">1</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="newafterbutton">
+                    <property name="MemberName" />
+                    <property name="Sensitive">False</property>
+                    <property name="Tooltip" translatable="yes">Insert a new category after the selected one</property>
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-goto-bottom Menu</property>
+                    <property name="Label" translatable="yes">New After</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnNewAfter" />
+                    <signal name="Activated" handler="OnNewBefore" />
+                  </widget>
+                  <packing>
+                    <property name="Position">2</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="removebutton">
+                    <property name="MemberName" />
+                    <property name="Sensitive">False</property>
+                    <property name="Tooltip" translatable="yes">Remove the selected category</property>
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-remove Menu</property>
+                    <property name="Label" translatable="yes">Remove</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnRemove" />
+                  </widget>
+                  <packing>
+                    <property name="Position">3</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="editbutton">
+                    <property name="MemberName" />
+                    <property name="Sensitive">False</property>
+                    <property name="Tooltip" translatable="yes">Edit the selected category</property>
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-edit Menu</property>
+                    <property name="Label" translatable="yes">Edit</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnEdit" />
+                  </widget>
+                  <packing>
+                    <property name="Position">4</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="exportbutton">
+                    <property name="MemberName" />
+                    <property name="Visible">False</property>
+                    <property name="Tooltip" translatable="yes">Export the template to a file</property>
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-save-as Menu</property>
+                    <property name="Label" translatable="yes">Export</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnExportbuttonClicked" />
+                  </widget>
+                  <packing>
+                    <property name="PackType">End</property>
+                    <property name="Position">5</property>
+                    <property name="AutoSize">True</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.HSeparator" id="hseparator1">
+                    <property name="MemberName" />
+                    <property name="Visible">False</property>
+                  </widget>
+                  <packing>
+                    <property name="PackType">End</property>
+                    <property name="Position">6</property>
+                    <property name="AutoSize">True</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="Position">0</property>
-                <property name="AutoSize">False</property>
-                <property name="Expand">False</property>
-                <property name="Fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="Gtk.Button" id="newprevbutton">
-                <property name="MemberName" />
-                <property name="Sensitive">False</property>
-                <property name="Tooltip" translatable="yes">Insert a new category before the selected one</property>
-                <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:gtk-goto-top Menu</property>
-                <property name="Label" translatable="yes">New Before</property>
-                <property name="UseUnderline">True</property>
-                <signal name="Clicked" handler="OnNewBefore" />
               </widget>
               <packing>
                 <property name="Position">1</property>
@@ -1457,103 +1574,14 @@
                 <property name="Fill">False</property>
               </packing>
             </child>
-            <child>
-              <widget class="Gtk.Button" id="newafterbutton">
-                <property name="MemberName" />
-                <property name="Sensitive">False</property>
-                <property name="Tooltip" translatable="yes">Insert a new category after the selected one</property>
-                <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:gtk-goto-bottom Menu</property>
-                <property name="Label" translatable="yes">New After</property>
-                <property name="UseUnderline">True</property>
-                <signal name="Clicked" handler="OnNewAfter" />
-                <signal name="Activated" handler="OnNewBefore" />
-              </widget>
-              <packing>
-                <property name="Position">2</property>
-                <property name="AutoSize">False</property>
-                <property name="Expand">False</property>
-                <property name="Fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="Gtk.Button" id="removebutton">
-                <property name="MemberName" />
-                <property name="Sensitive">False</property>
-                <property name="Tooltip" translatable="yes">Remove the selected category</property>
-                <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:gtk-remove Menu</property>
-                <property name="Label" translatable="yes">Remove</property>
-                <property name="UseUnderline">True</property>
-                <signal name="Clicked" handler="OnRemove" />
-              </widget>
-              <packing>
-                <property name="Position">3</property>
-                <property name="AutoSize">False</property>
-                <property name="Expand">False</property>
-                <property name="Fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="Gtk.Button" id="editbutton">
-                <property name="MemberName" />
-                <property name="Sensitive">False</property>
-                <property name="Tooltip" translatable="yes">Edit the selected category</property>
-                <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:gtk-edit Menu</property>
-                <property name="Label" translatable="yes">Edit</property>
-                <property name="UseUnderline">True</property>
-                <signal name="Clicked" handler="OnEdit" />
-              </widget>
-              <packing>
-                <property name="Position">4</property>
-                <property name="AutoSize">False</property>
-                <property name="Expand">False</property>
-                <property name="Fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="Gtk.Button" id="exportbutton">
-                <property name="MemberName" />
-                <property name="Visible">False</property>
-                <property name="Tooltip" translatable="yes">Export the template to a file</property>
-                <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:gtk-save-as Menu</property>
-                <property name="Label" translatable="yes">Export</property>
-                <property name="UseUnderline">True</property>
-                <signal name="Clicked" handler="OnExportbuttonClicked" />
-              </widget>
-              <packing>
-                <property name="PackType">End</property>
-                <property name="Position">5</property>
-                <property name="AutoSize">True</property>
-                <property name="Expand">False</property>
-                <property name="Fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="Gtk.HSeparator" id="hseparator1">
-                <property name="MemberName" />
-                <property name="Visible">False</property>
-              </widget>
-              <packing>
-                <property name="PackType">End</property>
-                <property name="Position">6</property>
-                <property name="AutoSize">True</property>
-                <property name="Expand">False</property>
-                <property name="Fill">False</property>
-              </packing>
-            </child>
+          </widget>
+        </child>
+        <child>
+          <widget class="Gtk.Label" id="label1">
+            <property name="MemberName" />
           </widget>
           <packing>
-            <property name="Position">1</property>
-            <property name="AutoSize">False</property>
-            <property name="Expand">False</property>
-            <property name="Fill">False</property>
+            <property name="type">tab</property>
           </packing>
         </child>
       </widget>
@@ -6576,4 +6604,137 @@ You can continue with the current capture, cancel it or save your project.
       </widget>
     </child>
   </widget>
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.GameUnitsEditor" design-size="561 299">
+    <property name="MemberName" />
+    <property name="Visible">False</property>
+    <child>
+      <widget class="Gtk.VBox" id="vbox2">
+        <property name="MemberName" />
+        <property name="Visible">False</property>
+        <property name="Spacing">6</property>
+        <child>
+          <widget class="Gtk.Label" id="label1">
+            <property name="MemberName" />
+            <property name="LabelProp" translatable="yes">&lt;b&gt;Game Units&lt;/b&gt;: Games are usually divided in time by units. In sports like field hockey the game is divided in 2 halves but other sports like tenis have several types of units that are anidated, e.g. Set-&gt;Game-&gt;Point.
+
+Defining &lt;b&gt; Game Units &lt;/b&gt; will help you during the analysis to indentify the tagged plays in the the phases of the game.</property>
+            <property name="UseMarkup">True</property>
+            <property name="Wrap">True</property>
+            <property name="WidthChars">70</property>
+          </widget>
+          <packing>
+            <property name="Position">0</property>
+            <property name="AutoSize">True</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
+            <property name="MemberName" />
+            <property name="CanFocus">True</property>
+            <property name="ShadowType">In</property>
+            <child>
+              <widget class="Gtk.Viewport" id="GtkViewport">
+                <property name="MemberName" />
+                <property name="ShadowType">None</property>
+                <child>
+                  <widget class="Gtk.VBox" id="outerbox">
+                    <property name="MemberName" />
+                    <property name="Visible">False</property>
+                    <property name="Spacing">6</property>
+                    <child>
+                      <widget class="Gtk.VBox" id="phasesbox">
+                        <property name="MemberName" />
+                        <property name="Spacing">6</property>
+                        <child>
+                          <placeholder />
+                        </child>
+                        <child>
+                          <placeholder />
+                        </child>
+                        <child>
+                          <placeholder />
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="Position">0</property>
+                        <property name="AutoSize">False</property>
+                        <property name="Expand">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="Gtk.VBox" id="fillerbox">
+                        <property name="MemberName" />
+                        <property name="Spacing">6</property>
+                        <child>
+                          <placeholder />
+                        </child>
+                        <child>
+                          <placeholder />
+                        </child>
+                        <child>
+                          <placeholder />
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="Position">1</property>
+                        <property name="AutoSize">False</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="Position">1</property>
+            <property name="AutoSize">True</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.HBox" id="hbox1">
+            <property name="MemberName" />
+            <property name="Spacing">6</property>
+            <child>
+              <widget class="Gtk.Entry" id="entry1">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="IsEditable">True</property>
+                <property name="InvisibleChar">â</property>
+              </widget>
+              <packing>
+                <property name="Position">0</property>
+                <property name="AutoSize">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="Gtk.Button" id="addbutton">
+                <property name="MemberName" />
+                <property name="Sensitive">False</property>
+                <property name="CanFocus">True</property>
+                <property name="Type">TextAndIcon</property>
+                <property name="Icon">stock:gtk-add Dialog</property>
+                <property name="Label" translatable="yes">Add game unit</property>
+                <property name="UseUnderline">True</property>
+              </widget>
+              <packing>
+                <property name="Position">1</property>
+                <property name="AutoSize">True</property>
+                <property name="Expand">False</property>
+                <property name="Fill">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="PackType">End</property>
+            <property name="Position">2</property>
+            <property name="AutoSize">True</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+      </widget>
+    </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 221f5d4..6f883de 100644
--- a/LongoMatch.GUI/gtk-gui/objects.xml
+++ b/LongoMatch.GUI/gtk-gui/objects.xml
@@ -185,15 +185,6 @@
       </itemgroup>
     </signals>
   </object>
-  <object type="LongoMatch.Gui.Component.TemplatesEditorBase" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups>
-      <itemgroup label="TemplatesEditorBase Properties">
-        <property name="CanExport" />
-        <property name="Edited" />
-      </itemgroup>
-    </itemgroups>
-    <signals />
-  </object>
   <object type="LongoMatch.Gui.Component.NotesWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
     <itemgroups />
     <signals>
@@ -232,21 +223,6 @@
       </itemgroup>
     </signals>
   </object>
-  <object type="LongoMatch.Gui.Component.TimeLineWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups>
-      <itemgroup label="TimeLineWidget Properties">
-        <property name="CurrentFrame" />
-      </itemgroup>
-    </itemgroups>
-    <signals>
-      <itemgroup label="TimeLineWidget Signals">
-        <signal name="TimeNodeChanged" />
-        <signal name="TimeNodeSelected" />
-        <signal name="TimeNodeDeleted" />
-        <signal name="NewMarkEvent" />
-      </itemgroup>
-    </signals>
-  </object>
   <object type="LongoMatch.Gui.Component.TeamTemplateEditorWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
     <itemgroups>
     </itemgroups>
@@ -314,4 +290,36 @@
       </itemgroup>
     </signals>
   </object>
+  <object type="LongoMatch.Gui.Component.TimeLineWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups>
+      <itemgroup label="TimeLineWidget Properties">
+        <property name="CurrentFrame" />
+      </itemgroup>
+    </itemgroups>
+    <signals>
+      <itemgroup label="TimeLineWidget Signals">
+        <signal name="TimeNodeChanged" />
+        <signal name="TimeNodeSelected" />
+        <signal name="TimeNodeDeleted" />
+        <signal name="NewMarkEvent" />
+      </itemgroup>
+    </signals>
+  </object>
+  <object type="LongoMatch.Gui.Component.GameUnitsEditor" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups />
+    <signals />
+  </object>
+  <object type="LongoMatch.Gui.Component.TemplatesEditorBase" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups>
+      <itemgroup label="TemplatesEditorBase Properties">
+        <property name="CanExport" />
+        <property name="Edited" />
+      </itemgroup>
+    </itemgroups>
+    <signals />
+  </object>
+  <object type="LongoMatch.Gui.Component.GameUnitsEditor" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups />
+    <signals />
+  </object>
 </objects>
\ No newline at end of file
diff --git a/LongoMatch/LongoMatch.mdp b/LongoMatch/LongoMatch.mdp
index 8134139..23e9b6c 100644
--- a/LongoMatch/LongoMatch.mdp
+++ b/LongoMatch/LongoMatch.mdp
@@ -4,12 +4,18 @@
       <Output directory="../bin" assembly="LongoMatch" />
       <Build debugmode="True" target="Exe" />
       <Execution consolepause="False" runwithwarnings="True" runtime="MsNet" />
+      <EnvironmentVariables>
+        <Variable name="LGM_DEBUG" value="3" />
+      </EnvironmentVariables>
       <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
     </Configuration>
     <Configuration name="Release" ctype="DotNetProjectConfiguration">
       <Output directory="../bin" assembly="LongoMatch" />
       <Build debugmode="False" target="Exe" />
       <Execution consolepause="False" runwithwarnings="True" runtime="MsNet" />
+      <EnvironmentVariables>
+        <Variable name="LGM_DEBUG" value="" />
+      </EnvironmentVariables>
       <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
     </Configuration>
   </Configurations>



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