[Monodevelop-patches-list] r731 - in trunk/MonoDevelop/src/Main/Base: Commands Gui/Components Internal/Codons/MenuItems Services/MenuService

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Jan 31 01:48:25 EST 2004


Author: tberman
Date: 2004-01-31 01:48:25 -0500 (Sat, 31 Jan 2004)
New Revision: 731

Modified:
   trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs
   trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs
   trunk/MonoDevelop/src/Main/Base/Services/MenuService/MenuService.cs
Log:
you know what every sexy patch needs, lots of sexy bugfixes. enjoy


Modified: trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs	2004-01-31 05:48:23 UTC (rev 730)
+++ trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs	2004-01-31 06:48:25 UTC (rev 731)
@@ -45,6 +45,7 @@
 				for (int i = 0; i < recentOpen.RecentFile.Count; ++i) {
 					string accelaratorKeyPrefix = i < 10 ? "&" + ((i + 1) % 10).ToString() + " " : "";
 					items[i] = new SdMenuCommand(null, null, accelaratorKeyPrefix + recentOpen.RecentFile[i].ToString(), new EventHandler(LoadRecentFile));
+					items[i].Key = recentOpen.RecentFile[i].ToString ();
 					items[i].Tag = recentOpen.RecentFile[i].ToString();
 					items[i].Description = stringParserService.Parse(resourceService.GetString("Dialog.Componnents.RichMenuItem.LoadFileDescription"),
 					                                          new string[,] { {"FILE", recentOpen.RecentFile[i].ToString()} });
@@ -81,6 +82,7 @@
 				for (int i = 0; i < recentOpen.RecentProject.Count; ++i) {
 					string accelaratorKeyPrefix = i < 10 ? "&" + ((i + 1) % 10).ToString() + " " : "";
 					items[i] = new SdMenuCommand(null, null, accelaratorKeyPrefix + recentOpen.RecentProject[i].ToString(), new EventHandler(LoadRecentProject));
+					items[i].Key = recentOpen.RecentProject[i].ToString ();
 					items[i].Tag = recentOpen.RecentProject[i].ToString();
 					items[i].Description = stringParserService.Parse(resourceService.GetString("Dialog.Componnents.RichMenuItem.LoadProjectDescription"),
 					                                         new string[,] { {"PROJECT", recentOpen.RecentProject[i].ToString()} });
@@ -183,7 +185,7 @@
 				return new Gtk.MenuItem[] {};
 			}
 			Gtk.MenuItem[] items = new Gtk.MenuItem[contentCount + 1];
-			items[0] = new SdMenuSeparator(null, null);
+			items [0] = new SdMenuSeparator ("OpenFilesSep", null, null);
 			for (int i = 0; i < contentCount; ++i) {
 				IViewContent content = (IViewContent)WorkbenchSingleton.Workbench.ViewContentCollection[i];
 				

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs	2004-01-31 05:48:23 UTC (rev 730)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs	2004-01-31 06:48:25 UTC (rev 731)
@@ -120,16 +120,16 @@
 
 		public void Append (Gtk.Widget item)
 		{
-			if (item.Parent == null) {
-				foreach (IStatusUpdate obj in subMenu.Children)
-				{
-					if (obj is SdMenuSeparator)
-						continue;
-					if (obj.Key == ((IStatusUpdate)item).Key)
-						return;
+			try {
+				if (item.Parent == null || (item as IStatusUpdate == null)) {
+					foreach (IStatusUpdate obj in subMenu.Children)
+					{
+						if (obj.Key == ((IStatusUpdate)item).Key)
+							return;
+					}
+					subMenu.Append (item);
 				}
-				subMenu.Append (item);
-			}
+			} catch { }
 		}
 	}
 }

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs	2004-01-31 05:48:23 UTC (rev 730)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs	2004-01-31 06:48:25 UTC (rev 731)
@@ -105,7 +105,7 @@
 			this.Activated += handler;
 			UpdateStatus();
 		}
-		
+
 		public SdMenuCommand(object caller, string label, EventHandler handler) : this(stringParserService.Parse(label))
 		{
 			this.caller = caller;

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs	2004-01-31 05:48:23 UTC (rev 730)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs	2004-01-31 06:48:25 UTC (rev 731)
@@ -28,11 +28,12 @@
 			set { key = value; }
 		}
 		
-		public SdMenuSeparator()
+		public SdMenuSeparator(string id)
 		{
+			key = id;
 		}
 		
-		public SdMenuSeparator(ConditionCollection conditionCollection, object caller)
+		public SdMenuSeparator(string id, ConditionCollection conditionCollection, object caller) : this (id)
 		{
 			this.caller              = caller;
 			this.conditionCollection = conditionCollection;

Modified: trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs	2004-01-31 05:48:23 UTC (rev 730)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs	2004-01-31 06:48:25 UTC (rev 731)
@@ -100,7 +100,7 @@
 		{
 			Gtk.MenuItem newItem = null;
 			if (Label == "-") {
-				newItem = new SdMenuSeparator(conditions, owner);
+				newItem = new SdMenuSeparator(ID, conditions, owner);
 			} else  if (Link != null) {
 				newItem = new SdMenuCommand(conditions, null, Label,  Link.StartsWith("http") ? (IMenuCommand)new GotoWebSite(Link) : (IMenuCommand)new GotoLink(Link));
 			} else {

Modified: trunk/MonoDevelop/src/Main/Base/Services/MenuService/MenuService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/MenuService/MenuService.cs	2004-01-31 05:48:23 UTC (rev 730)
+++ trunk/MonoDevelop/src/Main/Base/Services/MenuService/MenuService.cs	2004-01-31 06:48:25 UTC (rev 731)
@@ -118,7 +118,7 @@
 			Gtk.Menu contextMenu = new Gtk.Menu();
 			for (int i = 0; i < quickInsertMenuItems.GetLength(0); ++i) {
 				if (quickInsertMenuItems[i, 0] == "-") {
-					contextMenu.Append(new SdMenuSeparator());
+					contextMenu.Append(new SdMenuSeparator("-"));
 				} else {
 					SdMenuCommand cmd = new SdMenuCommand(this,
 					                                      stringParserService.Parse(quickInsertMenuItems[i, 0]),




More information about the Monodevelop-patches-list mailing list