[longomatch/refactor] WIP



commit 7f270d14e1608273121018184fc15b060b66a0e1
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Nov 4 02:16:22 2011 +0100

    WIP

 LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs       |    2 +-
 LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic       |    4 +-
 .../Gui/Component/ProjectDetailsWidget.cs          |    3 +-
 LongoMatch.GUI/Gui/Component/TeamTaggerWidget.cs   |    8 +-
 LongoMatch.GUI/Gui/Dialog/DrawingTool.cs           |    3 +-
 .../Gui/Dialog/VideoEditionProperties.cs           |   10 +--
 LongoMatch.GUI/Gui/MainWindow.cs                   |   12 ++--
 LongoMatch.GUI/Gui/Popup/MessagePopup.cs           |    1 +
 .../LongoMatch.Gui.Dialog.EditCategoryDialog.cs    |    4 +-
 .../LongoMatch.Gui.Dialog.EndCaptureDialog.cs      |    4 +-
 ...Match.Gui.Dialog.FramesCaptureProgressDialog.cs |    2 +-
 .../LongoMatch.Gui.Dialog.HotKeySelectorDialog.cs  |    2 +-
 .../gtk-gui/LongoMatch.Gui.MainWindow.cs           |    2 +-
 .../gtk-gui/LongoMatch.Gui.Popup.CalendarPopup.cs  |    2 +-
 LongoMatch.GUI/gtk-gui/gui.stetic                  |   19 +++---
 LongoMatch.GUI/gtk-gui/objects.xml                 |   76 ++++++++++----------
 LongoMatch.Services/Services/Core.cs               |   11 ++-
 LongoMatch.Services/Services/ProjectsManager.cs    |   26 +++++---
 LongoMatch.Services/Services/TemplatesService.cs   |    8 +-
 LongoMatch/Main.cs                                 |    7 +--
 20 files changed, 106 insertions(+), 100 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs b/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
index 20a3c8c..7db84e3 100644
--- a/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/CapturerBin.cs
@@ -169,7 +169,7 @@ namespace LongoMatch.Gui
 					capturerhbox.Remove(capturer as Gtk.Widget);
 					capturer.Dispose();
 				}
-			} catch(Exception e) {}
+			} catch(Exception) {}
 			capturer = null;
 		}
 
diff --git a/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic b/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic
index 59a91c9..edd1885 100644
--- a/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI.Multimedia/gtk-gui/gui.stetic
@@ -5,9 +5,9 @@
     <target-gtk-version>2.12</target-gtk-version>
   </configuration>
   <import>
-    <widget-library name="../../LongoMatch.Multimedia/bin/Debug/LongoMatch.Multimedia.dll" />
+    <widget-library name="../../bin/LongoMatch.Multimedia.dll" />
     <widget-library name="../../bin/LongoMatch.Core.dll" />
-    <widget-library name="../../bin/a.dll" internal="true" />
+    <widget-library name="../../bin/LongoMatch.GUI.Multimedia.dll" internal="true" />
   </import>
   <widget class="Gtk.Window" id="LongoMatch.Gui.VolumeWindow" design-size="31 204">
     <property name="MemberName" />
diff --git a/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs b/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs
index 2ce690e..696a146 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectDetailsWidget.cs
@@ -59,7 +59,6 @@ namespace LongoMatch.Gui.Component
 		ListStore encProfileList;
 		private const string DV_SOURCE = "DV Source";
 		private const string GCONF_SOURCE = "GConf Source";
-		string videosDir;
 
 
 		public ProjectDetailsWidget()
@@ -442,7 +441,7 @@ namespace LongoMatch.Gui.Component
 				                                 FileChooserAction.Save,
 				                                 "gtk-cancel",ResponseType.Cancel,
 				                                 "gtk-save",ResponseType.Accept);
-				fChooser.SetCurrentFolder(videosDir);
+				fChooser.SetCurrentFolder(Config.VideosDir());
 				fChooser.DoOverwriteConfirmation = true;
 				if(fChooser.Run() == (int)ResponseType.Accept)
 					fileEntry.Text = fChooser.Filename;
diff --git a/LongoMatch.GUI/Gui/Component/TeamTaggerWidget.cs b/LongoMatch.GUI/Gui/Component/TeamTaggerWidget.cs
index 4f09310..73dacb3 100644
--- a/LongoMatch.GUI/Gui/Component/TeamTaggerWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/TeamTaggerWidget.cs
@@ -26,10 +26,10 @@ namespace LongoMatch.Gui.Component
 	[System.ComponentModel.ToolboxItem(true)]
 	public partial class TeamTaggerWidget : Gtk.Bin
 	{
-		private Dictionary<TeamTag, CheckButton> dict;
-		private TeamSubCategory subcat;
-		private TeamsTagStore tags;
-		private string subcategory, localTeam, visitorTeam;
+		Dictionary<TeamTag, CheckButton> dict;
+		TeamSubCategory subcat;
+		TeamsTagStore tags;
+		string localTeam, visitorTeam;
 		
 		
 		public TeamTaggerWidget (TeamSubCategory subcat, TeamsTagStore tags, 
diff --git a/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs b/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
index a8b2823..70a7423 100644
--- a/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
+++ b/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
@@ -32,7 +32,6 @@ namespace LongoMatch.Gui.Dialog
 	{
 		Play play;
 		int stopTime;
-		string snapshotsDir;
 
 		public DrawingTool()
 		{
@@ -102,7 +101,7 @@ namespace LongoMatch.Gui.Dialog
 			                                 FileChooserAction.Save,
 			                                 "gtk-cancel",ResponseType.Cancel,
 			                                 "gtk-save",ResponseType.Accept);
-			fChooser.SetCurrentFolder(snapshotsDir);
+			fChooser.SetCurrentFolder(Config.SnapshotsDir());
 			fChooser.Filter = filter;
 			fChooser.DoOverwriteConfirmation = true;
 
diff --git a/LongoMatch.GUI/Gui/Dialog/VideoEditionProperties.cs b/LongoMatch.GUI/Gui/Dialog/VideoEditionProperties.cs
index bb7d06a..8aea741 100644
--- a/LongoMatch.GUI/Gui/Dialog/VideoEditionProperties.cs
+++ b/LongoMatch.GUI/Gui/Dialog/VideoEditionProperties.cs
@@ -32,11 +32,9 @@ namespace LongoMatch.Gui.Dialog
 	[System.ComponentModel.ToolboxItem(false)]
 	public partial class VideoEditionProperties : Gtk.Dialog
 	{
-		private EncodingSettings encSettings;
-		private ListStore stdStore;
-		private ListStore encStore;
-		private string videosDir;
-
+		EncodingSettings encSettings;
+		ListStore stdStore;
+		ListStore encStore;
 
 		#region Constructors
 		public VideoEditionProperties()
@@ -148,7 +146,7 @@ namespace LongoMatch.Gui.Dialog
 			                FileChooserAction.Save,
 			                "gtk-cancel",ResponseType.Cancel,
 			                "gtk-save",ResponseType.Accept);
-			fChooser.SetCurrentFolder(videosDir);
+			fChooser.SetCurrentFolder(Config.VideosDir());
 			fChooser.CurrentName = "NewVideo."+GetExtension();
 			fChooser.DoOverwriteConfirmation = true;
 			FileFilter filter = new FileFilter();
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index fb99c65..e1fa5f2 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -689,27 +689,27 @@ namespace LongoMatch.Gui
 		}
 		
 		private void EmitOpenProject() {
-			if(OpenProjectEvent == null)
+			if(OpenProjectEvent != null)
 				OpenProjectEvent();
 		}
 		
 		private void EmitExportProject() {
-			if(ExportProjectEvent == null)
+			if(ExportProjectEvent != null)
 				ExportProjectEvent();
 		}
 		
 		private void EmitManageJobs() {
-			if(ManageJobsEvent == null)
+			if(ManageJobsEvent != null)
 				ManageJobsEvent();
 		}
 		
 		private void EmitManageTeams() {
-			if(ManageTeamsEvent == null)
+			if(ManageTeamsEvent != null)
 				ManageTeamsEvent();
 		}
 		
 		private void EmitManageCategories() {
-			if(ManageCategoriesEvent == null)
+			if(ManageCategoriesEvent != null)
 				ManageCategoriesEvent();
 		}
 		
@@ -730,7 +730,7 @@ namespace LongoMatch.Gui
 		}
 		
 		private void EmitSavePlaylist() {
-			if (SavePlaylistEvent != null) 
+			if (SavePlaylistEvent != null)
 				SavePlaylistEvent();
 		}
 		#endregion
diff --git a/LongoMatch.GUI/Gui/Popup/MessagePopup.cs b/LongoMatch.GUI/Gui/Popup/MessagePopup.cs
index 0bcfe25..8db6b9e 100644
--- a/LongoMatch.GUI/Gui/Popup/MessagePopup.cs
+++ b/LongoMatch.GUI/Gui/Popup/MessagePopup.cs
@@ -1,3 +1,4 @@
+
 //
 //  Copyright (C) 2007-2009 Andoni Morales Alastruey
 //
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EditCategoryDialog.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EditCategoryDialog.cs
index db485e0..3f86b79 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EditCategoryDialog.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EditCategoryDialog.cs
@@ -48,8 +48,8 @@ namespace LongoMatch.Gui.Dialog
 			if ((this.Child != null)) {
 				this.Child.ShowAll ();
 			}
-			this.DefaultWidth = 492;
-			this.DefaultHeight = 191;
+			this.DefaultWidth = 522;
+			this.DefaultHeight = 280;
 			this.Show ();
 		}
 	}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs
index e911ea2..2cc66b7 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs
@@ -165,8 +165,8 @@ namespace LongoMatch.Gui.Dialog
 			if ((this.Child != null)) {
 				this.Child.ShowAll ();
 			}
-			this.DefaultWidth = 517;
-			this.DefaultHeight = 175;
+			this.DefaultWidth = 566;
+			this.DefaultHeight = 178;
 			w34.Hide ();
 			this.Show ();
 			this.returnbutton.Clicked += new global::System.EventHandler (this.OnQuit);
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.FramesCaptureProgressDialog.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.FramesCaptureProgressDialog.cs
index 1f3d6f2..4f63b1d 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.FramesCaptureProgressDialog.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.FramesCaptureProgressDialog.cs
@@ -84,7 +84,7 @@ namespace LongoMatch.Gui.Dialog
 				this.Child.ShowAll ();
 			}
 			this.DefaultWidth = 400;
-			this.DefaultHeight = 148;
+			this.DefaultHeight = 149;
 			this.okbutton.Hide ();
 			this.Show ();
 			this.cancelbutton.Clicked += new global::System.EventHandler (this.OnButtonCancelClicked);
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.HotKeySelectorDialog.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.HotKeySelectorDialog.cs
index 6ecf7bf..0e65282 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.HotKeySelectorDialog.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.HotKeySelectorDialog.cs
@@ -51,7 +51,7 @@ namespace LongoMatch.Gui.Dialog
 				this.Child.ShowAll ();
 			}
 			this.DefaultWidth = 385;
-			this.DefaultHeight = 94;
+			this.DefaultHeight = 109;
 			this.Show ();
 		}
 	}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 6b49d9d..414df01 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -138,7 +138,7 @@ namespace LongoMatch.Gui
 			this.ImportProjectAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("_Import Project");
 			w1.Add (this.ImportProjectAction, "<Control>i");
 			this.ManualTaggingViewAction = new global::Gtk.RadioAction ("ManualTaggingViewAction", global::Mono.Unix.Catalog.GetString ("Manual tagging view"), null, null, 0);
-			this.ManualTaggingViewAction.Group = this.TimelineViewAction.Group;
+			this.ManualTaggingViewAction.Group = this.TaggingViewAction.Group;
 			this.ManualTaggingViewAction.Sensitive = false;
 			this.ManualTaggingViewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Free Capture Mode");
 			w1.Add (this.ManualTaggingViewAction, "<Control>f");
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Popup.CalendarPopup.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Popup.CalendarPopup.cs
index 2f2543b..ea02770 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Popup.CalendarPopup.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Popup.CalendarPopup.cs
@@ -30,7 +30,7 @@ namespace LongoMatch.Gui.Popup
 				this.Child.ShowAll ();
 			}
 			this.DefaultWidth = 281;
-			this.DefaultHeight = 154;
+			this.DefaultHeight = 214;
 			this.Show ();
 			this.FocusOutEvent += new global::Gtk.FocusOutEventHandler (this.OnFocusOutEvent);
 			this.calendar1.DaySelectedDoubleClick += new global::System.EventHandler (this.OnCalendar1DaySelectedDoubleClick);
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 52d2649..be766da 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -900,7 +900,7 @@
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Window" id="LongoMatch.Gui.Popup.CalendarPopup" design-size="281 154">
+  <widget class="Gtk.Window" id="LongoMatch.Gui.Popup.CalendarPopup" design-size="281 214">
     <property name="MemberName" />
     <property name="Title" translatable="yes" />
     <property name="WindowPosition">Mouse</property>
@@ -2062,7 +2062,7 @@
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoryProperties" design-size="438 392">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoryProperties" design-size="516 392">
     <property name="MemberName" />
     <child>
       <widget class="Gtk.VBox" id="vbox2">
@@ -3647,7 +3647,7 @@ Extra</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.FramesCaptureProgressDialog" design-size="400 148">
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.FramesCaptureProgressDialog" design-size="400 149">
     <property name="MemberName" />
     <property name="Title" translatable="yes">Capture Progress</property>
     <property name="Icon">stock:longomatch Dialog</property>
@@ -3849,7 +3849,7 @@ You can download it using this direct link:</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.HotKeySelectorDialog" design-size="385 94">
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.HotKeySelectorDialog" design-size="385 109">
     <property name="MemberName" />
     <property name="Title" translatable="yes">Select a HotKey</property>
     <property name="Icon">stock:longomatch Dialog</property>
@@ -3902,7 +3902,7 @@ Hotkeys with a single key are also allowed with Ctrl+key.</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlayerProperties" design-size="270 286">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlayerProperties" design-size="278 318">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
@@ -4700,7 +4700,7 @@ No</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DrawingToolBox" design-size="86 382">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DrawingToolBox" design-size="94 398">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
@@ -5059,7 +5059,7 @@ Show-&gt;&lt;b&gt; S&lt;/b&gt;
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.EditCategoryDialog" design-size="492 191">
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.EditCategoryDialog" design-size="522 280">
     <property name="MemberName" />
     <property name="Title" translatable="yes">Category Details</property>
     <property name="Icon">resource:longomatch.png</property>
@@ -5620,7 +5620,6 @@ Show-&gt;&lt;b&gt; S&lt;/b&gt;
                     <property name="MemberName" />
                     <property name="CanFocus">True</property>
                     <property name="Label" translatable="yes">New project using a video file</property>
-                    <property name="Active">True</property>
                     <property name="DrawIndicator">True</property>
                     <property name="HasLabel">True</property>
                     <property name="UseUnderline">True</property>
@@ -5783,7 +5782,7 @@ Show-&gt;&lt;b&gt; S&lt;/b&gt;
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.EndCaptureDialog" design-size="517 175">
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.EndCaptureDialog" design-size="566 178">
     <property name="MemberName" />
     <property name="Title" translatable="yes" />
     <property name="Icon">stock:longomatch Menu</property>
@@ -6236,7 +6235,7 @@ You can continue with the current capture, cancel it or save your project.
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlayersTaggerWidget" design-size="300 40">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.PlayersTaggerWidget" design-size="300 48">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
diff --git a/LongoMatch.GUI/gtk-gui/objects.xml b/LongoMatch.GUI/gtk-gui/objects.xml
index 287b824..522585e 100644
--- a/LongoMatch.GUI/gtk-gui/objects.xml
+++ b/LongoMatch.GUI/gtk-gui/objects.xml
@@ -52,23 +52,6 @@
     </itemgroups>
     <signals />
   </object>
-  <object type="LongoMatch.Gui.Component.ProjectDetailsWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups>
-      <itemgroup label="ProjectDetailsWidget Properties">
-        <property name="Edited" />
-        <property name="Season" />
-        <property name="Competition" />
-        <property name="LocalGoals" />
-        <property name="VisitorGoals" />
-        <property name="Date" />
-      </itemgroup>
-    </itemgroups>
-    <signals>
-      <itemgroup label="ProjectDetailsWidget Signals">
-        <signal name="EditedEvent" />
-      </itemgroup>
-    </signals>
-  </object>
   <object type="LongoMatch.Gui.Component.PlayersListTreeWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
     <itemgroups />
     <signals>
@@ -138,14 +121,6 @@
       </itemgroup>
     </signals>
   </object>
-  <object type="LongoMatch.Gui.Component.CategoryProperties" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
-    <itemgroups />
-    <signals>
-      <itemgroup label="CategoryProperties Signals">
-        <signal name="HotKeyChanged" />
-      </itemgroup>
-    </signals>
-  </object>
   <object type="LongoMatch.Gui.Component.PlayersTaggerWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
     <itemgroups />
     <signals />
@@ -272,19 +247,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.TimeLineWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
     <itemgroups>
       <itemgroup label="TimeLineWidget Properties">
@@ -315,4 +277,42 @@
     </itemgroups>
     <signals />
   </object>
+  <object type="LongoMatch.Gui.Component.CategoryProperties" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups />
+    <signals>
+      <itemgroup label="CategoryProperties Signals">
+        <signal name="HotKeyChanged" />
+      </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.ProjectDetailsWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+    <itemgroups>
+      <itemgroup label="ProjectDetailsWidget Properties">
+        <property name="Edited" />
+        <property name="Season" />
+        <property name="Competition" />
+        <property name="LocalGoals" />
+        <property name="VisitorGoals" />
+        <property name="Date" />
+      </itemgroup>
+    </itemgroups>
+    <signals>
+      <itemgroup label="ProjectDetailsWidget Signals">
+        <signal name="EditedEvent" />
+      </itemgroup>
+    </signals>
+  </object>
 </objects>
\ No newline at end of file
diff --git a/LongoMatch.Services/Services/Core.cs b/LongoMatch.Services/Services/Core.cs
index 050016f..a0200f2 100644
--- a/LongoMatch.Services/Services/Core.cs
+++ b/LongoMatch.Services/Services/Core.cs
@@ -31,19 +31,24 @@ namespace LongoMatch.Services
 		static DataBase db;
 		static TemplatesService ts;
 
-		public static void Init(MainWindow mainWindow)
+		public static void Init()
 		{
 			Log.Debugging = Debugging;
 			Log.Information("Starting " + Constants.SOFTWARE_NAME);
 
+			SetupBaseDir();
+
 			/* Init internationalization support */
 			Catalog.Init(Constants.SOFTWARE_NAME.ToLower(),Config.RelativeToPrefix("share/locale"));
 
-			SetupBaseDir();
+			/* Init Gtk */
+			Application.Init();
 
 			/* Check default folders */
 			CheckDirs();
-			
+		}
+
+		public static void Start(MainWindow mainWindow) {
 			StartServices(mainWindow);
 			BindEvents(mainWindow);
 		}
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index abdd74c..cceceeb 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -44,6 +44,18 @@ namespace LongoMatch.Services
 		
 		public ProjectsManager(MainWindow mainWindow) {
 			this.mainWindow = mainWindow;
+			ConnectSignals();
+		}
+
+		public void ConnectSignals() {
+			mainWindow.NewProjectEvent += NewProject;
+			mainWindow.OpenProjectEvent += OpenProject;
+			mainWindow.SaveProjectEvent += SaveProject;
+			mainWindow.ImportProjectEvent += ImportProject;
+			mainWindow.ExportProjectEvent += ExportProject;
+			mainWindow.ManageProjectsEvent += OpenProjectsManager;
+			mainWindow.ManageCategoriesEvent += OpenCategoriesTemplatesManager;
+			mainWindow.ManageTeamsEvent += OpenTeamsTemplatesManager;
 		}
 		
 		public Project OpenedProject {
@@ -446,7 +458,7 @@ namespace LongoMatch.Services
 			}
 		}
 		
-		protected virtual void OnNewProject() {
+		protected virtual void NewProject() {
 			Project project;
 			ProjectType projectType;
 			CaptureSettings captureSettings;
@@ -456,7 +468,7 @@ namespace LongoMatch.Services
 				SetProject(project, projectType, captureSettings);
 		}
 		
-		protected void OnOpenProject() {
+		protected void OpenProject() {
 			ProjectDescription project=null;
 			OpenProjectDialog opd = new OpenProjectDialog();
 			
@@ -468,17 +480,13 @@ namespace LongoMatch.Services
 				SetProject(Core.DB.GetProject(project.UUID), ProjectType.FileProject, new CaptureSettings());
 		}
 		
-		protected void OnImportProject() {
-			ImportProject();
-		}
-		
 		protected void ExportProject() {
 			/* FIXME:
 			 * ExportToCSV(this, openedProject);
 			 * */
 		}
 		
-		protected virtual void OnSectionsTemplatesManagerActivated(object sender, System.EventArgs e)
+		protected void OpenCategoriesTemplatesManager()
 		{
 			var tManager = new TemplatesManager<Categories, Category>(Core.TemplatesService.CategoriesTemplateProvider,
 			                                                          Core.TemplatesService.GetTemplateEditor<Categories, Category>());
@@ -486,7 +494,7 @@ namespace LongoMatch.Services
 			tManager.Show();
 		}
 
-		protected virtual void OnTeamsTemplatesManagerActionActivated(object sender, System.EventArgs e)
+		protected void OpenTeamsTemplatesManager()
 		{
 			var tManager = new TemplatesManager<TeamTemplate, Player>(Core.TemplatesService.TeamTemplateProvider,
 			                                                          Core.TemplatesService.GetTemplateEditor<TeamTemplate, Player>());
@@ -494,7 +502,7 @@ namespace LongoMatch.Services
 			tManager.Show();
 		}
 		
-		protected virtual void OnDatabaseManagerActivated(object sender, System.EventArgs e)
+		protected void OpenProjectsManager()
 		{
 			Gui.Dialog.ProjectsManager pm = new Gui.Dialog.ProjectsManager(openedProject, Core.DB);
 			pm.TransientFor = mainWindow;
diff --git a/LongoMatch.Services/Services/TemplatesService.cs b/LongoMatch.Services/Services/TemplatesService.cs
index 3cd2c3c..34e21a5 100644
--- a/LongoMatch.Services/Services/TemplatesService.cs
+++ b/LongoMatch.Services/Services/TemplatesService.cs
@@ -136,10 +136,10 @@ namespace LongoMatch.Services
 	
 	public class TemplatesProvider<T, U>: ITemplateProvider<T, U> where T: ITemplate<U>
 	{
-		private readonly string basePath;
-		private readonly string extension;
-		private readonly MethodInfo methodLoad;
-		private readonly MethodInfo methodDefaultTemplate;
+		readonly string basePath;
+		readonly string extension;
+		readonly MethodInfo methodLoad;
+		readonly MethodInfo methodDefaultTemplate;
 		
 		public TemplatesProvider (string basePath, string extension)
 		{
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index f92cdd3..47fa170 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -44,14 +44,11 @@ namespace LongoMatch
 			if (!GStreamer.CheckInstallation())
 				return;
 
-			/* Init Gtk */
-			Application.Init();
-
 			//try {
-				Log.Information("TEST");
+				Core.Init();
 				MainWindow win = new MainWindow();
 				win.Show();
-				Core.Init(win);
+				Core.Start(win);
 				Application.Run();
 			//} catch(Exception ex) {
 			//	ProcessExecutionError(ex);



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