[Monodevelop-patches-list] r2780 - in trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets: . Commands
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Tue Aug 23 12:19:32 EDT 2005
Author: lluis
Date: 2005-08-23 12:19:31 -0400 (Tue, 23 Aug 2005)
New Revision: 2780
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs
Log:
2005-08-23 Lluis Sanchez Gual <lluis at novell.com>
* Commands/CommandManager.cs: Added EnableIdleUpdate property.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog 2005-08-23 01:05:19 UTC (rev 2779)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/ChangeLog 2005-08-23 16:19:31 UTC (rev 2780)
@@ -1,3 +1,7 @@
+2005-08-23 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Commands/CommandManager.cs: Added EnableIdleUpdate property.
+
2005-08-20 John Luke <john.luke at gmail.com>
* Commands/CommandFrame.cs:
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs 2005-08-23 01:05:19 UTC (rev 2779)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Gui.Widgets/Commands/CommandManager.cs 2005-08-23 16:19:31 UTC (rev 2780)
@@ -45,6 +45,7 @@
Stack delegatorStack = new Stack ();
bool disposed;
bool toolbarUpdaterRunning;
+ bool enableToolbarUpdate;
Gtk.AccelGroup accelGroup;
@@ -74,6 +75,26 @@
disposed = true;
}
+ public bool EnableIdleUpdate {
+ get { return enableToolbarUpdate; }
+ set {
+ if (enableToolbarUpdate != value) {
+ if (value) {
+ if (toolbars.Count > 0) {
+ if (!toolbarUpdaterRunning) {
+ GLib.Timeout.Add (500, new GLib.TimeoutHandler (UpdateStatus));
+ toolbarUpdaterRunning = true;
+ }
+ }
+ } else {
+ toolbarUpdaterRunning = false;
+ }
+ enableToolbarUpdate = value;
+ }
+ }
+ }
+
+
public void RegisterCommand (Command cmd)
{
RegisterCommand (cmd, "");
@@ -211,6 +232,7 @@
}
catch (Exception ex) {
string name = (cmd != null && cmd.Text != null && cmd.Text.Length > 0) ? cmd.Text : commandId.ToString ();
+ name = name.Replace ("_","");
ReportError (commandId, "Error while executing command: " + name, ex);
return false;
}
@@ -391,19 +413,18 @@
bool UpdateStatus ()
{
- if (!disposed) {
+ if (!disposed)
UpdateToolbars ();
- return true;
- } else {
+ else
toolbarUpdaterRunning = false;
- return false;
- }
+
+ return toolbarUpdaterRunning;
}
internal void RegisterToolbar (CommandToolbar toolbar)
{
toolbars.Add (toolbar);
- if (!toolbarUpdaterRunning) {
+ if (enableToolbarUpdate && !toolbarUpdaterRunning) {
GLib.Timeout.Add (500, new GLib.TimeoutHandler (UpdateStatus));
toolbarUpdaterRunning = true;
}
More information about the Monodevelop-patches-list
mailing list