[longomatch] Add missing files to the previous commit



commit a49b5c063beee659631a66f2807141588dc3c99c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Oct 19 17:33:58 2012 +0200

    Add missing files to the previous commit

 LongoMatch.GUI/Gui/MainWindow.cs                   |   17 +++++++++++------
 .../gtk-gui/LongoMatch.Gui.MainWindow.cs           |    2 +-
 LongoMatch.GUI/gtk-gui/gui.stetic                  |    4 +---
 3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 5bb6bce..3cdefed 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -135,6 +135,9 @@ namespace LongoMatch.Gui
 			if (!Config.useGameUnits)
 				GameUnitsViewAction.Visible = false;
 			
+			AddImportEntry(Catalog.GetString("Import file project"), "ImportFileProject",
+			               Constants.PROJECT_NAME, "*" + Constants.PROJECT_EXT, Project.Import,
+			               false);
 			screen = Display.Default.DefaultScreen;
 			this.Resize(screen.Width * 80 / 100, screen.Height * 80 / 100);
 		}
@@ -214,11 +217,13 @@ 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");
+		public void AddImportEntry (string name, string shortName, string filterName,
+		                            string filter, Func<string, Project> importFunc,
+		                            bool requiresNewFile) {
+			MenuItem parent = (MenuItem) this.UIManager.GetWidget("/menubar1/FileAction/ImportProjectAction");
 			
 			MenuItem item = new MenuItem(name);
-			item.Activated += (sender, e) => (importAction(null, guiToolKit));
+			item.Activated += (sender, e) => (EmitImportProject(name, filterName, filter, importFunc, requiresNewFile));
 			item.Show();
 			(parent.Submenu as Menu).Append(item);
 		}
@@ -283,7 +288,6 @@ namespace LongoMatch.Gui
 		private void ConnectMenuSignals() {
 			SaveProjectAction.Activated += (o, e) => {EmitSaveProject();};
 			CloseProjectAction.Activated += (o, e) => {PromptCloseProject();};
-		    ImportFromFileAction.Activated += (o, e) => {EmitImportProject();};
 			ExportToProjectFileAction.Activated += (o, e) => {EmitExportProject();};
 			QuitAction.Activated += (o, e) => {CloseAndQuit();};
 			CategoriesTemplatesManagerAction.Activated += (o, e) => {EmitManageCategories();};
@@ -794,9 +798,10 @@ namespace LongoMatch.Gui
 			ResetGUI();
 		}
 		
-		private void EmitImportProject() {
+		private void EmitImportProject(string name, string filterName, string filter,
+		                               Func<string, Project> func, bool requiresNewFile) {
 			if (ImportProjectEvent != null)
-				ImportProjectEvent();
+				ImportProjectEvent(name, filterName, filter, func, requiresNewFile);
 		}
 		
 		private void EmitOpenProject() {
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index a7fe305..87abe98 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -180,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/><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.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'/><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'><menuit
 em 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 b828607..deb537c 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -1833,9 +1833,7 @@
                     <node type="Menuitem" action="SaveProjectAction" />
                     <node type="Menuitem" action="CloseProjectAction" />
                     <node type="Separator" />
-                    <node type="Menu" action="ImportProjectAction">
-                      <node type="Menuitem" action="ImportFromFileAction" />
-                    </node>
+                    <node type="Menu" action="ImportProjectAction" />
                     <node type="Separator" />
                     <node type="Menuitem" action="QuitAction" />
                   </node>



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