[Monodevelop-patches-list] r730 - trunk/MonoDevelop/src/Main/Base/Gui/Components

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


Author: tberman
Date: 2004-01-31 00:48:23 -0500 (Sat, 31 Jan 2004)
New Revision: 730

Modified:
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCheckBox.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs
Log:
damn damn damn, this is some *SEXY* bugfixing


Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs	2004-01-31 05:24:39 UTC (rev 729)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs	2004-01-31 05:48:23 UTC (rev 730)
@@ -21,6 +21,10 @@
 	public interface IStatusUpdate
 	{
 		void UpdateStatus();
+		string Key {
+			get;
+			set;
+		}
 	}
 	
 	public class SdMenu : Gtk.ImageMenuItem, IStatusUpdate
@@ -32,6 +36,13 @@
 		string localizedText = String.Empty;
 		public ArrayList SubItems = new ArrayList();
 		private Gtk.Menu subMenu = null;
+
+		private string key;
+
+		public string Key {
+			get { return key; }
+			set { key = value; }
+		}
 		
 		public SdMenu(ConditionCollection conditionCollection, object caller, string text) : base()
 		{
@@ -62,6 +73,7 @@
 			Gtk.AccelGroup accel = new Gtk.AccelGroup ();
 			subMenu.AccelGroup = accel;
 			((Gtk.Window)WorkbenchSingleton.Workbench).AddAccelGroup (accel);
+			key = text;
 		}
 		
 		public void OnDropDown(object ob, System.EventArgs e)
@@ -84,9 +96,9 @@
 			}
 			
 			if (Visible) {
-				foreach (Gtk.Widget widg in ((Gtk.Menu)Submenu).Children) {
-					((Gtk.Menu)Submenu).Remove (widg);
-				}
+				//foreach (Gtk.Widget widg in ((Gtk.Menu)Submenu).Children) {
+				//	((Gtk.Menu)Submenu).Remove (widg);
+				//}
 				foreach (object item in SubItems) {
 					if (item is Gtk.MenuItem) {
 						if (item is IStatusUpdate) {
@@ -109,6 +121,13 @@
 		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;
+				}
 				subMenu.Append (item);
 			}
 		}

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCheckBox.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCheckBox.cs	2004-01-31 05:24:39 UTC (rev 729)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCheckBox.cs	2004-01-31 05:48:23 UTC (rev 730)
@@ -26,6 +26,13 @@
 		string localizedText = String.Empty;
 		ICheckableMenuCommand menuCommand;
 
+		string key;
+
+		public string Key {
+			get { return key; }
+			set { key = value; }
+		}
+
 		object _tag;
 
 		public object Tag {
@@ -45,6 +52,7 @@
 		public SdMenuCheckBox (string label) : base (label)
 		{
 			Toggled += new EventHandler (OnClick);
+			key = label;
 		}
 	
 		public SdMenuCheckBox(ConditionCollection conditionCollection, object caller, string label) : this(stringParserService.Parse(label))

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs	2004-01-31 05:24:39 UTC (rev 729)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs	2004-01-31 05:48:23 UTC (rev 730)
@@ -27,6 +27,12 @@
 		string description   = String.Empty;
 		string localizedText = String.Empty;
 		ICommand menuCommand = null;
+		string key;
+
+		public string Key {
+			get { return key; }
+			set { key = value; }
+		}
 		
 		string tag;
 		
@@ -72,6 +78,7 @@
 			label.UseUnderline = true;
 			this.Child = label;
 			label.AccelWidget = this;
+			key = text;
 		}
 		
 		public SdMenuCommand(ConditionCollection conditionCollection, object caller, string label) : this(stringParserService.Parse(label))

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs	2004-01-31 05:24:39 UTC (rev 729)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs	2004-01-31 05:48:23 UTC (rev 730)
@@ -20,6 +20,13 @@
 	{
 		object caller;
 		ConditionCollection conditionCollection;
+
+		string key;
+
+		public string Key {
+			get { return key; }
+			set { key = value; }
+		}
 		
 		public SdMenuSeparator()
 		{

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs	2004-01-31 05:24:39 UTC (rev 729)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs	2004-01-31 05:48:23 UTC (rev 730)
@@ -27,6 +27,13 @@
 		string description   = String.Empty;
 		string localizedText = String.Empty;
 		ICommand menuCommand = null;
+
+		string key;
+
+		public string Key {
+			get { return key; }
+			set { key = value; }
+		}
 		
 		public ICommand Command {
 			get {




More information about the Monodevelop-patches-list mailing list