[Monodevelop-patches-list] r733 - 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 13:40:50 EST 2004
Author: tberman
Date: 2004-01-31 13:40:50 -0500 (Sat, 31 Jan 2004)
New Revision: 733
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/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
trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs
trunk/MonoDevelop/src/Main/Base/Services/MenuService/MenuService.cs
Log:
reverting my menu patches from last night, as they really uncover more uglyness and dont fix all the problems.
Modified: trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs 2004-01-31 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Commands/MenuItemBuilders.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -45,7 +45,6 @@
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()} });
@@ -82,7 +81,6 @@
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()} });
@@ -185,7 +183,7 @@
return new Gtk.MenuItem[] {};
}
Gtk.MenuItem[] items = new Gtk.MenuItem[contentCount + 1];
- items [0] = new SdMenuSeparator ("OpenFilesSep", null, null);
+ items[0] = new SdMenuSeparator(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 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenu.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -21,10 +21,6 @@
public interface IStatusUpdate
{
void UpdateStatus();
- string Key {
- get;
- set;
- }
}
public class SdMenu : Gtk.ImageMenuItem, IStatusUpdate
@@ -36,13 +32,6 @@
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()
{
@@ -73,7 +62,6 @@
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)
@@ -96,9 +84,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) {
@@ -120,16 +108,9 @@
public void Append (Gtk.Widget item)
{
- 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);
- }
- } catch { }
+ if (item.Parent == null) {
+ 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 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCheckBox.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -26,13 +26,6 @@
string localizedText = String.Empty;
ICheckableMenuCommand menuCommand;
- string key;
-
- public string Key {
- get { return key; }
- set { key = value; }
- }
-
object _tag;
public object Tag {
@@ -52,7 +45,6 @@
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 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -27,12 +27,6 @@
string description = String.Empty;
string localizedText = String.Empty;
ICommand menuCommand = null;
- string key;
-
- public string Key {
- get { return key; }
- set { key = value; }
- }
string tag;
@@ -78,7 +72,6 @@
label.UseUnderline = true;
this.Child = label;
label.AccelWidget = this;
- key = text;
}
public SdMenuCommand(ConditionCollection conditionCollection, object caller, string label) : this(stringParserService.Parse(label))
@@ -105,7 +98,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 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuSeparator.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -20,20 +20,12 @@
{
object caller;
ConditionCollection conditionCollection;
-
- string key;
-
- public string Key {
- get { return key; }
- set { key = value; }
- }
- public SdMenuSeparator(string id)
+ public SdMenuSeparator()
{
- key = id;
}
- public SdMenuSeparator(string id, ConditionCollection conditionCollection, object caller) : this (id)
+ public SdMenuSeparator(ConditionCollection conditionCollection, object caller)
{
this.caller = caller;
this.conditionCollection = conditionCollection;
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs 2004-01-31 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdToolbarCommand.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -27,13 +27,6 @@
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 {
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs 2004-01-31 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -100,7 +100,7 @@
{
Gtk.MenuItem newItem = null;
if (Label == "-") {
- newItem = new SdMenuSeparator(ID, conditions, owner);
+ newItem = new SdMenuSeparator(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 07:01:57 UTC (rev 732)
+++ trunk/MonoDevelop/src/Main/Base/Services/MenuService/MenuService.cs 2004-01-31 18:40:50 UTC (rev 733)
@@ -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