[longomatch] Add support for plugins to import projects



commit 26b9c939fec7ddad099717d97a2d5dca1778a392
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Oct 17 16:55:19 2012 +0200

    Add support for plugins to import projects

 LongoMatch.Addins/AddinsManager.cs                 |   14 +++++--
 .../ExtensionPoints/IImportProject.cs              |   36 ++++++++++++++++++++
 LongoMatch.Addins/LongoMatch.Addins.mdp            |    1 +
 LongoMatch.Addins/Makefile.am                      |    1 +
 LongoMatch.Core/Config.cs                          |    9 +++++
 LongoMatch.Core/Handlers/Handlers.cs               |    4 ++-
 LongoMatch.Core/Interfaces/GUI/IMainWindow.cs      |    2 +
 LongoMatch.Core/Store/MediaFile.cs                 |    2 +-
 LongoMatch.Core/Store/Project.cs                   |    4 ++
 .../Store/Templates/CategoriesTemplate.cs          |   19 ++++++----
 LongoMatch.GUI/Gui/MainWindow.cs                   |   12 ++++++-
 .../gtk-gui/LongoMatch.Gui.MainWindow.cs           |   10 ++++--
 LongoMatch.GUI/gtk-gui/gui.stetic                  |    9 ++++-
 LongoMatch.Services/Services/ProjectsManager.cs    |   30 ++++++++++++++--
 LongoMatch.mds                                     |    4 ++
 LongoMatch/Main.cs                                 |    3 +-
 16 files changed, 137 insertions(+), 23 deletions(-)
---
diff --git a/LongoMatch.Addins/AddinsManager.cs b/LongoMatch.Addins/AddinsManager.cs
index 72f4eec..db69050 100644
--- a/LongoMatch.Addins/AddinsManager.cs
+++ b/LongoMatch.Addins/AddinsManager.cs
@@ -30,10 +30,10 @@ namespace LongoMatch.Addins
 {
 	public class AddinsManager
 	{
-		public AddinsManager (string addinsPath)
+		public AddinsManager (string configPath, string searchPath)
 		{
-			Log.Information("Initializing addins at path: " + addinsPath);
-			AddinManager.Initialize (addinsPath);
+			Log.Information("Initializing addins at path: " + searchPath);
+			AddinManager.Initialize (configPath, searchPath);
 			AddinManager.Registry.Update();
 		}
 		
@@ -47,7 +47,13 @@ namespace LongoMatch.Addins
 			foreach (IExportProject exportProject in AddinManager.GetExtensionObjects<IExportProject> ()) {
 				mainWindow.AddExportEntry(exportProject.GetMenuEntryName(), exportProject.GetMenuEntryShortName(),
 					new Action<Project, IGUIToolkit>(exportProject.ExportProject));
-			
+			}
+		}
+		
+		public void LoadImportProjectAddins(IMainWindow mainWindow) {
+			foreach (IImportProject importProject in AddinManager.GetExtensionObjects<IImportProject> ()) {
+				mainWindow.AddImportEntry(importProject.GetMenuEntryName(), importProject.GetMenuEntryShortName(),
+				    importProject.GetFilterName(), importProject.GetFilter(), importProject.ImportProject, true);
 			}
 		}
 	}
diff --git a/LongoMatch.Addins/ExtensionPoints/IImportProject.cs b/LongoMatch.Addins/ExtensionPoints/IImportProject.cs
new file mode 100644
index 0000000..7671140
--- /dev/null
+++ b/LongoMatch.Addins/ExtensionPoints/IImportProject.cs
@@ -0,0 +1,36 @@
+// 
+//  Copyright (C) 2011 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 Mono.Addins;
+
+using LongoMatch.Store;
+using LongoMatch.Interfaces.GUI;
+
+namespace LongoMatch.Addins.ExtensionPoints
+{
+	[TypeExtensionPoint]
+	public interface IImportProject
+	{
+		string GetMenuEntryName();
+		string GetMenuEntryShortName();
+		string GetFilterName();
+		string GetFilter();
+		Project ImportProject(string filename);
+	}
+}
+
diff --git a/LongoMatch.Addins/LongoMatch.Addins.mdp b/LongoMatch.Addins/LongoMatch.Addins.mdp
index cc693da..fa6c26d 100644
--- a/LongoMatch.Addins/LongoMatch.Addins.mdp
+++ b/LongoMatch.Addins/LongoMatch.Addins.mdp
@@ -18,6 +18,7 @@
     <File subtype="Code" buildaction="Compile" name="ExtensionPoints/IConfigModifier.cs" />
     <File subtype="Code" buildaction="Compile" name="AddinsManager.cs" />
     <File subtype="Directory" buildaction="Compile" name="." />
+    <File subtype="Code" buildaction="Compile" name="ExtensionPoints/IImportProject.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Addins, Version=0.6.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
diff --git a/LongoMatch.Addins/Makefile.am b/LongoMatch.Addins/Makefile.am
index 62912c8..fd8dc84 100644
--- a/LongoMatch.Addins/Makefile.am
+++ b/LongoMatch.Addins/Makefile.am
@@ -6,6 +6,7 @@ LINK = $(REF_DEP_LONGOMATCH_ADDINS)
 SOURCES = \
 	AddinsManager.cs \
 	ExtensionPoints/IConfigModifier.cs \
+	ExtensionPoints/IImportProject.cs \
 	ExtensionPoints/IExportProject.cs
 
 RESOURCES =
diff --git a/LongoMatch.Core/Config.cs b/LongoMatch.Core/Config.cs
index dc25016..3ada124 100644
--- a/LongoMatch.Core/Config.cs
+++ b/LongoMatch.Core/Config.cs
@@ -56,6 +56,15 @@ namespace LongoMatch
 			return RelativeToPrefix(String.Format("share/{0}/images",
 						Constants.SOFTWARE_NAME.ToLower()));
 		}
+		
+		public static string PluginsDir() {
+			return RelativeToPrefix(String.Format("share/{0}/plugins",
+						Constants.SOFTWARE_NAME.ToLower()));
+		}
+		
+		public static string PluginsConfigDir() {
+			return Path.Combine(configDirectory, "addins");
+		}
 
 		public static string DBDir() {
 			return Path.Combine(configDirectory, "db");
diff --git a/LongoMatch.Core/Handlers/Handlers.cs b/LongoMatch.Core/Handlers/Handlers.cs
index 9a877fd..5fe2e04 100644
--- a/LongoMatch.Core/Handlers/Handlers.cs
+++ b/LongoMatch.Core/Handlers/Handlers.cs
@@ -21,6 +21,7 @@
 using System;
 using System.Collections.Generic;
 using LongoMatch.Interfaces;
+using LongoMatch.Interfaces.GUI;
 using LongoMatch.Store;
 using LongoMatch.Common;
 
@@ -51,7 +52,8 @@ namespace LongoMatch.Handlers
 	public delegate void OpenProjectHandler();
 	public delegate void CloseOpenendProjectHandler(bool save);
 	public delegate void NewProjectHandler();
-	public delegate void ImportProjectHandler();
+	public delegate void ImportProjectHandler(string name, string filterName, string filter,
+	                                          Func <string, Project> importProjectFunc, bool requiresNewFile);
 	public delegate void ExportProjectHandler();
 	
 	/* GUI */
diff --git a/LongoMatch.Core/Interfaces/GUI/IMainWindow.cs b/LongoMatch.Core/Interfaces/GUI/IMainWindow.cs
index 827246a..4f0cb3b 100644
--- a/LongoMatch.Core/Interfaces/GUI/IMainWindow.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IMainWindow.cs
@@ -86,6 +86,8 @@ namespace LongoMatch.Interfaces.GUI
 		ITemplatesService TemplatesService{set;}
 		
 		void AddExportEntry (string name, string shortName, Action<Project, IGUIToolkit> exportAction);
+		void AddImportEntry (string name, string shortName, string filterName, string filter,
+		                     Func<string, Project> importFunc, bool requiresNewFile);
 	}
 }
 
diff --git a/LongoMatch.Core/Store/MediaFile.cs b/LongoMatch.Core/Store/MediaFile.cs
index 62d49c1..a571f5e 100644
--- a/LongoMatch.Core/Store/MediaFile.cs
+++ b/LongoMatch.Core/Store/MediaFile.cs
@@ -161,7 +161,7 @@ namespace LongoMatch.Store
 		
 		public double Par {
 			get {
-				if (par == null)
+				if (par == 0)
 					return 1;
 				return par;
 			}
diff --git a/LongoMatch.Core/Store/Project.cs b/LongoMatch.Core/Store/Project.cs
index a02069a..7ead86e 100644
--- a/LongoMatch.Core/Store/Project.cs
+++ b/LongoMatch.Core/Store/Project.cs
@@ -169,6 +169,10 @@ namespace LongoMatch.Store
 			return play;
 		}
 		
+		public void AddPlay (Play play) {
+			timeline.Add(play);
+		}
+		
 		/// <summary>
 		/// Delete a play from the project
 		/// </summary>
diff --git a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs b/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
index ecab9a2..0ded69c 100644
--- a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
@@ -69,12 +69,10 @@ namespace LongoMatch.Store.Templates
 		public void Save(string filePath) {
 			SerializableObject.Save(this, filePath);
 		}
-		
-		public void AddDefaultItem (int index) {
+	
+		public void AddDefaultSubcategories (Category cat) {
 			PlayerSubCategory localplayers, visitorplayers;
 			TagSubCategory period;
-			Color c = Color.FromArgb(255, 0, 0);
-			HotKey h = new HotKey();
 			
 			localplayers = new PlayerSubCategory {
 				Name = Catalog.GetString("Local Team Players"),
@@ -95,6 +93,15 @@ namespace LongoMatch.Store.Templates
 			};
 			period.Add("1");
 			period.Add("2");
+			cat.SubCategories.Add(localplayers);
+			cat.SubCategories.Add(visitorplayers);
+			cat.SubCategories.Add(period);
+		}	
+		
+		public void AddDefaultItem (int index) {
+			Color c = Color.FromArgb(255, 0, 0);
+			HotKey h = new HotKey();
+			
 			
 			Category cat =  new Category {
 				Name = "Category " + index,
@@ -105,9 +112,7 @@ namespace LongoMatch.Store.Templates
 				HotKey = h,
 				Position = index-1,
 			};
-			cat.SubCategories.Add(localplayers);
-			cat.SubCategories.Add(visitorplayers);
-			cat.SubCategories.Add(period);
+			AddDefaultSubcategories(cat);
 			Insert(index, cat);
 		}
 
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index ee2ca57..5bb6bce 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -214,6 +214,14 @@ namespace LongoMatch.Gui
 			(parent.Submenu as Menu).Append(item);
 		}
 		
+		public void AddImportEntry (string name, string shortName, Action<string, IGUIToolkit> importAction) {
+			MenuItem parent = (MenuItem) this.UIManager.GetWidget("/menubar1/ToolsAction/ImportProjectAction1");
+			
+			MenuItem item = new MenuItem(name);
+			item.Activated += (sender, e) => (importAction(null, guiToolKit));
+			item.Show();
+			(parent.Submenu as Menu).Append(item);
+		}
 		#endregion
 		
 		#region Private Methods
@@ -275,7 +283,7 @@ namespace LongoMatch.Gui
 		private void ConnectMenuSignals() {
 			SaveProjectAction.Activated += (o, e) => {EmitSaveProject();};
 			CloseProjectAction.Activated += (o, e) => {PromptCloseProject();};
-			ImportProjectAction.Activated += (o, e) => {EmitImportProject();};
+		    ImportFromFileAction.Activated += (o, e) => {EmitImportProject();};
 			ExportToProjectFileAction.Activated += (o, e) => {EmitExportProject();};
 			QuitAction.Activated += (o, e) => {CloseAndQuit();};
 			CategoriesTemplatesManagerAction.Activated += (o, e) => {EmitManageCategories();};
@@ -866,6 +874,8 @@ namespace LongoMatch.Gui
 			if (KeyPressed != null)
 				KeyPressed(sender, key, modifier);
 		}
+
+
 		#endregion
 	}
 }
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index b5e19ba..a7fe305 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -34,6 +34,7 @@ namespace LongoMatch.Gui
 		private global::Gtk.Action Action;
 		private global::Gtk.Action ExportToProjectFileAction;
 		private global::Gtk.Action dialogInfoAction;
+		private global::Gtk.Action ImportFromFileAction;
 		private global::Gtk.VBox vbox1;
 		private global::Gtk.VBox menubox;
 		private global::Gtk.MenuBar menubar1;
@@ -136,12 +137,12 @@ 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");
 			this.GameUnitsViewAction = new global::Gtk.RadioAction ("GameUnitsViewAction", global::Mono.Unix.Catalog.GetString ("Game units view"), null, null, 0);
-			this.GameUnitsViewAction.Group = this.TimelineViewAction.Group;
+			this.GameUnitsViewAction.Group = this.TaggingViewAction.Group;
 			this.GameUnitsViewAction.Sensitive = false;
 			this.GameUnitsViewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Game units view");
 			w1.Add (this.GameUnitsViewAction, null);
@@ -160,6 +161,9 @@ namespace LongoMatch.Gui
 			this.dialogInfoAction = new global::Gtk.Action ("dialogInfoAction", global::Mono.Unix.Catalog.GetString ("Shortcuts"), null, "gtk-dialog-info");
 			this.dialogInfoAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Shortcuts");
 			w1.Add (this.dialogInfoAction, null);
+			this.ImportFromFileAction = new global::Gtk.Action ("ImportFromFileAction", global::Mono.Unix.Catalog.GetString ("Import from file"), null, null);
+			this.ImportFromFileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Import from file");
+			w1.Add (this.ImportFromFileAction, null);
 			this.UIManager.InsertActionGroup (w1, 0);
 			this.AddAccelGroup (this.UIManager.AccelGroup);
 			this.Name = "LongoMatch.Gui.MainWindow";
@@ -176,7 +180,7 @@ namespace LongoMatch.Gui
 			this.menubox.Name = "menubox";
 			this.menubox.Spacing = 6;
 			// Container child menubox.Gtk.Box+BoxChild
-			this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewPojectAction' action='NewPojectAction'/><menuitem name='openAction' action='openAction'/><menuitem name='SaveProjectAction' action='SaveProjectAction'/><menuitem name='CloseProjectAction' action='CloseProjectAction'/><separator/><menuitem name='ImportProjectAction' action='ImportProjectAction'/><separator/><menuitem name='QuitAction' action='QuitAction'/></menu><menu name='ToolsAction' action='ToolsAction'><menuitem name='ProjectsManagerAction' action='ProjectsManagerAction'/><menuitem name='CategoriesTemplatesManagerAction' action='CategoriesTemplatesManagerAction'/><menuitem name='TeamsTemplatesManagerAction' action='TeamsTemplatesManagerAction'/><menu name='ExportProjectAction1' action='ExportProjectAction1'><menuitem name='ExportToProjectFileAction' action='ExportToProjectFileAction'/></menu></menu><menu name='ViewAction' action='ViewAction'><me
 nuitem name='FullScreenAction' action='FullScreenAction'/><menuitem name='HideAllWidgetsAction' action='HideAllWidgetsAction'/><separator/><menuitem name='PlaylistAction' action='PlaylistAction'/><separator/><menuitem name='TaggingViewAction' action='TaggingViewAction'/><menuitem name='ManualTaggingViewAction' action='ManualTaggingViewAction'/><menuitem name='TimelineViewAction' action='TimelineViewAction'/><menuitem name='GameUnitsViewAction' action='GameUnitsViewAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='HelpAction1' action='HelpAction1'/><menuitem name='dialogInfoAction' action='dialogInfoAction'/></menu></menubar></ui>");
+			this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewPojectAction' action='NewPojectAction'/><menuitem name='openAction' action='openAction'/><menuitem name='SaveProjectAction' action='SaveProjectAction'/><menuitem name='CloseProjectAction' action='CloseProjectAction'/><separator/><menu name='ImportProjectAction' action='ImportProjectAction'><menuitem name='ImportFromFileAction' action='ImportFromFileAction'/></menu><separator/><menuitem name='QuitAction' action='QuitAction'/></menu><menu name='ToolsAction' action='ToolsAction'><menuitem name='ProjectsManagerAction' action='ProjectsManagerAction'/><menuitem name='CategoriesTemplatesManagerAction' action='CategoriesTemplatesManagerAction'/><menuitem name='TeamsTemplatesManagerAction' action='TeamsTemplatesManagerAction'/><menu name='ExportProjectAction1' action='ExportProjectAction1'><menuitem name='ExportToProjectFileAction' action='ExportToProjectFil
 eAction'/></menu></menu><menu name='ViewAction' action='ViewAction'><menuitem name='FullScreenAction' action='FullScreenAction'/><menuitem name='HideAllWidgetsAction' action='HideAllWidgetsAction'/><separator/><menuitem name='PlaylistAction' action='PlaylistAction'/><separator/><menuitem name='TaggingViewAction' action='TaggingViewAction'/><menuitem name='ManualTaggingViewAction' action='ManualTaggingViewAction'/><menuitem name='TimelineViewAction' action='TimelineViewAction'/><menuitem name='GameUnitsViewAction' action='GameUnitsViewAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='HelpAction1' action='HelpAction1'/><menuitem name='dialogInfoAction' action='dialogInfoAction'/></menu></menubar></ui>");
 			this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
 			this.menubar1.Name = "menubar1";
 			this.menubox.Add (this.menubar1);
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 7c36656..b828607 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -1804,6 +1804,11 @@
         <property name="StockId">gtk-dialog-info</property>
         <signal name="Activated" handler="OnDialogInfoActionActivated" />
       </action>
+      <action id="ImportFromFileAction">
+        <property name="Type">Action</property>
+        <property name="Label" translatable="yes">Import from file</property>
+        <property name="ShortLabel" translatable="yes">Import from file</property>
+      </action>
     </action-group>
     <property name="MemberName" />
     <property name="Title" translatable="yes">LongoMatch</property>
@@ -1828,7 +1833,9 @@
                     <node type="Menuitem" action="SaveProjectAction" />
                     <node type="Menuitem" action="CloseProjectAction" />
                     <node type="Separator" />
-                    <node type="Menuitem" action="ImportProjectAction" />
+                    <node type="Menu" action="ImportProjectAction">
+                      <node type="Menuitem" action="ImportFromFileAction" />
+                    </node>
                     <node type="Separator" />
                     <node type="Menuitem" action="QuitAction" />
                   </node>
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index 2abf520..022114b 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -115,14 +115,15 @@ namespace LongoMatch.Services
 			SetProject(project, ProjectType.FileProject, new CaptureSettings());
 		}
 	
-		private void ImportProject() {
+		private void ImportProject(string name, string filterName, string filter,
+		                           Func<string, Project> importProject, bool requiresNewFile) {
 			Project project;
 			string fileName;
 
 			Log.Debug("Importing project");
 			/* Show a file chooser dialog to select the file to import */
-			fileName = guiToolkit.OpenFile(Catalog.GetString("Import Project"), null,
-				Config.HomeDir(), Constants.PROJECT_NAME, "*lpr");
+			fileName = guiToolkit.OpenFile(name, null,
+				Config.HomeDir(), filterName, filter);
 				
 			if(fileName == null)
 				return;
@@ -130,7 +131,7 @@ namespace LongoMatch.Services
 			/* try to import the project and show a message error is the file
 			 * is not a valid project */
 			try {
-				project = Project.Import(fileName);
+				project = importProject(fileName);
 			}
 			catch(Exception ex) {
 				guiToolkit.ErrorMessage(Catalog.GetString("Error importing project:") +
@@ -139,6 +140,27 @@ namespace LongoMatch.Services
 				return;
 			}
 
+			if (requiresNewFile) {
+				string videofile;
+				
+				guiToolkit.InfoMessage (Catalog.GetString("This project doesn't have any file associated.\n" +
+				                                          "Select one in the next window"));
+				videofile = guiToolkit.OpenFile(Catalog.GetString("Select a video file"), null,
+				                                                 Config.HomeDir(), null, null);
+				if (videofile == null) {
+					guiToolkit.ErrorMessage (Catalog.GetString("Could not import project, you need a video file"));
+					return;
+				} else {
+					try {
+						project.Description.File = multimediaToolkit.DiscoverFile(videofile);
+					} catch (Exception ex) {
+						guiToolkit.ErrorMessage (ex.Message);
+						return;
+					}
+					CreateThumbnails (project);
+				}
+			}
+			
 			/* If the project exists ask if we want to overwrite it */
 			if(Core.DB.Exists(project)) {
 				var res = guiToolkit.QuestionMessage(Catalog.GetString("A project already exists for the file:") +
diff --git a/LongoMatch.mds b/LongoMatch.mds
index 26745c4..492e82e 100644
--- a/LongoMatch.mds
+++ b/LongoMatch.mds
@@ -27,6 +27,7 @@
       <Entry build="True" name="LongoMatch.GUI.Multimedia" configuration="Debug" />
       <Entry build="True" name="LongoMatch.Addins" configuration="Debug" />
       <Entry build="True" name="LongoMatch.Addins.COE" configuration="Debug" />
+      <Entry build="True" name="LongoMatch.Plugins" configuration="Debug" />
     </Configuration>
     <Configuration name="Release" ctype="CombineConfiguration">
       <Entry build="True" name="LongoMatch.GUI" configuration="Release" />
@@ -38,6 +39,7 @@
       <Entry build="True" name="LongoMatch.GUI.Multimedia" configuration="Release" />
       <Entry build="True" name="LongoMatch.Addins" configuration="Release" />
       <Entry build="True" name="LongoMatch.Addins.COE" configuration="Release" />
+      <Entry build="True" name="LongoMatch.Plugins" configuration="Release" />
     </Configuration>
   </Configurations>
   <StartMode startupentry="LongoMatchGtk" single="True">
@@ -50,6 +52,7 @@
     <Execute type="None" entry="LongoMatch.GUI.Multimedia" />
     <Execute type="None" entry="LongoMatch.Addins" />
     <Execute type="None" entry="LongoMatch.Addins.COE" />
+    <Execute type="None" entry="LongoMatch.Plugins" />
   </StartMode>
   <Entries>
     <Entry filename="LongoMatch.GUI/LongoMatch.GUI.mdp" />
@@ -61,5 +64,6 @@
     <Entry filename="LongoMatch.GUI.Multimedia/LongoMatch.GUI.Multimedia.mdp" />
     <Entry filename="LongoMatch.Addins/LongoMatch.Addins.mdp" />
     <Entry filename="LongoMatch.Addins.COE/LongoMatch.Addins.COE.mdp" />
+    <Entry filename="LongoMatch.Plugins/LongoMatch.Plugins.mdp" />
   </Entries>
 </Combine>
\ No newline at end of file
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index 80b0a23..f70b0b7 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -58,11 +58,12 @@ namespace LongoMatch
 			Version version = Assembly.GetExecutingAssembly().GetName().Version;
 
 			try {
-				AddinsManager manager = new AddinsManager(Path.Combine(Config.HomeDir(), "addins"));
+				AddinsManager manager = new AddinsManager(Config.PluginsConfigDir(), Config.PluginsDir());
 				manager.LoadConfigModifierAddins();
 			    GUIToolkit guiToolkit = new GUIToolkit(version);
 			    IMultimediaToolkit multimediaToolkit = new MultimediaFactory();
 			    manager.LoadExportProjectAddins(guiToolkit.MainWindow);
+			    manager.LoadImportProjectAddins(guiToolkit.MainWindow);
 				Core.Start(guiToolkit, multimediaToolkit);
 				Application.Run();
 			} catch(Exception ex) {



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