Author: lluis Date: 2008-01-18 09:06:12 -0500 (Fri, 18 Jan 2008) New Revision: 93254
Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/ChangeLog branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/OutputProgressMonitor.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic Log: 2008-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]> * MonoDevelop.Ide.mdp, gtk-gui/gui.stetic, gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs, gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs, gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs, gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs, gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs, gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs: Updated. 2008-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]> * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Queue.Peek returns the head of the queue, not the tail. Use a field to store the last text write request. Made buffer bigger and reduced timeout for updating the textview. * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Make it subclass NullProgessMonitor since this class is now gui thread safe. Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/ChangeLog =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/ChangeLog 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/ChangeLog 2008-01-18 14:06:12 UTC (rev 93254) @@ -1,3 +1,22 @@ +2008-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]> + + * MonoDevelop.Ide.mdp, gtk-gui/gui.stetic, + gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs, + gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs, + gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs, + gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs, + gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs, + gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs: Updated. + +2008-01-18 Lluis Sanchez Gual <[EMAIL PROTECTED]> + + * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Queue.Peek returns the head + of the queue, not the tail. Use a field to store the last text write + request. Made buffer bigger and reduced timeout for updating the + textview. + * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Make it subclass + NullProgessMonitor since this class is now gui thread safe. + 2008-01-17 Lluis Sanchez Gual <[EMAIL PROTECTED]> * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Avoid going through the gui Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/OutputProgressMonitor.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/OutputProgressMonitor.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/OutputProgressMonitor.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -45,7 +45,7 @@ namespace MonoDevelop.Ide.Gui { - internal class OutputProgressMonitor : BaseProgressMonitor, IConsole + internal class OutputProgressMonitor : NullProgressMonitor, IConsole { DefaultMonitorPad outputPad; event EventHandler stopRequested; @@ -57,17 +57,9 @@ pad.AsyncOperation = this.AsyncOperation; outputPad = pad; outputPad.BeginProgress (title); - - //using the DefaultMonitorPad's method here to make sure we don't mess with the remoted dispatch - //mechanisms *at all* (even just accessing a field from an anon delegate invokes remoting) - //We're hooking up our own logger to avoid cost of context switching via remoting through the - //AsyncDispatch of base class's WriteLogInternal - //HORRIBLE HACK:To get it properly deteched, we have to replace the actual logger. logger.TextWritten += outputPad.WriteText; - ((LogTextWriter) base.Log).TextWritten += outputPad.WriteText; } - [FreeDispatch] public override void BeginTask (string name, int totalWork) { if (outputPad == null) throw GetDisposedException (); @@ -75,7 +67,6 @@ base.BeginTask (name, totalWork); } - [FreeDispatch] public override void EndTask () { if (outputPad == null) throw GetDisposedException (); @@ -88,14 +79,14 @@ if (outputPad == null) throw GetDisposedException (); outputPad.WriteText ("\n"); - foreach (string msg in SuccessMessages) + foreach (string msg in Messages) outputPad.WriteText (msg + "\n"); foreach (string msg in Warnings) outputPad.WriteText (msg + "\n"); - foreach (string msg in Errors) - outputPad.WriteError (msg + "\n"); + foreach (ProgressError msg in Errors) + outputPad.WriteError (msg.Message + "\n"); outputPad.EndProgress (); base.OnCompleted (); @@ -115,30 +106,28 @@ stopRequested (this, null); } + public override TextWriter Log { + get { return logger; } + } + TextReader IConsole.In { - [FreeDispatch] get { return new StringReader (""); } } TextWriter IConsole.Out { - [FreeDispatch] get { return logger; } } TextWriter IConsole.Error { - [FreeDispatch] get { return logger; } } bool IConsole.CloseOnDispose { - [FreeDispatch] get { return false; } } event EventHandler IConsole.CancelRequested { - [FreeDispatch] add { stopRequested += value; } - [FreeDispatch] remove { stopRequested -= value; } } } Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -71,10 +71,11 @@ private IAsyncOperation asyncOperation; Queue updates = new Queue (); + QueuedTextWrite lastTextWrite; GLib.TimeoutHandler outputDispatcher; bool outputDispatcherRunning = false; - const int MAX_BUFFER_LENGTH = 20 * 1024; + const int MAX_BUFFER_LENGTH = 200 * 1024; public DefaultMonitorPad (string typeTag, string icon, int instanceNum) { @@ -143,6 +144,7 @@ bool outputDispatchHandler () { lock (updates.SyncRoot) { + lastTextWrite = null; if (updates.Count == 0) { outputDispatcherRunning = false; return false; @@ -214,18 +216,26 @@ lock (updates.SyncRoot) { updates.Enqueue (update); if (!outputDispatcherRunning) { - GLib.Timeout.Add (500, outputDispatcher); + GLib.Timeout.Add (50, outputDispatcher); outputDispatcherRunning = true; } + lastTextWrite = update as QueuedTextWrite; } } public void BeginProgress (string title) { - originalTitle = window.Title; - buffer.Clear (); - window.Title = "<span foreground=\"blue\">" + originalTitle + "</span>"; - buttonStop.Sensitive = true; + lock (updates.SyncRoot) { + updates.Clear (); + lastTextWrite = null; + } + + Gtk.Application.Invoke (delegate { + originalTitle = window.Title; + buffer.Clear (); + window.Title = "<span foreground=\"blue\">" + originalTitle + "</span>"; + buttonStop.Sensitive = true; + }); } protected void UnsafeBeginTask (string name, int totalWork) @@ -263,10 +273,9 @@ { //raw text has an extra optimisation here, as we can append it to existing updates lock (updates.SyncRoot) { - if (updates.Count > 0) { - QueuedTextWrite w = updates.Peek () as QueuedTextWrite; - if (w != null && w.Tag == null) { - w.Write (text); + if (lastTextWrite != null) { + if (lastTextWrite.Tag == null) { + lastTextWrite.Write (text); return; } } @@ -314,8 +323,10 @@ public void EndProgress () { - window.Title = originalTitle; - buttonStop.Sensitive = false; + Gtk.Application.Invoke (delegate { + window.Title = originalTitle; + buttonStop.Sensitive = false; + }); } protected void UnsafeAddText (string text, TextTag extraTag) @@ -369,6 +380,10 @@ public virtual void Dispose () { + lock (updates.SyncRoot) { + updates.Clear (); + lastTextWrite = null; + } } public void RedrawContent() Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -108,7 +108,6 @@ this.frame1 = new Gtk.Frame(); this.frame1.Name = "frame1"; this.frame1.ShadowType = ((Gtk.ShadowType)(1)); - this.frame1.LabelXalign = 0F; // Container child frame1.Gtk.Container+ContainerChild this.GtkAlignment2 = new Gtk.Alignment(0F, 0F, 1F, 1F); this.GtkAlignment2.Name = "GtkAlignment2"; Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -155,7 +155,6 @@ // Container child vbox4.Gtk.Box+BoxChild this.frame2 = new Gtk.Frame(); this.frame2.Name = "frame2"; - this.frame2.LabelXalign = 0F; this.frame2.LabelYalign = 0F; // Container child frame2.Gtk.Container+ContainerChild this.lbl_template_descr = new Gtk.Label(); @@ -341,8 +340,6 @@ w25.Position = 1; w25.Expand = false; this.notebook.Add(this.vbox1); - Gtk.Notebook.NotebookChild w26 = ((Gtk.Notebook.NotebookChild)(this.notebook[this.vbox1])); - w26.TabExpand = false; // Notebook tab this.label1 = new Gtk.Label(); this.label1.Name = "label1"; @@ -387,7 +384,6 @@ this.notebook.Add(this.vbox5); Gtk.Notebook.NotebookChild w30 = ((Gtk.Notebook.NotebookChild)(this.notebook[this.vbox5])); w30.Position = 1; - w30.TabExpand = false; // Notebook tab this.label2 = new Gtk.Label(); this.label2.Name = "label2"; Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -302,7 +302,7 @@ this.Child.ShowAll(); } this.DefaultWidth = 642; - this.DefaultHeight = 309; + this.DefaultHeight = 313; this.findButton.HasDefault = true; this.Show(); } Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -80,8 +80,6 @@ this.label7.Yalign = 0F; this.label7.LabelProp = "label7"; this.mainBook.Add(this.label7); - Gtk.Notebook.NotebookChild w2 = ((Gtk.Notebook.NotebookChild)(this.mainBook[this.label7])); - w2.TabExpand = false; // Notebook tab this.label6 = new Gtk.Label(); this.label6.Name = "label6"; Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs 2008-01-18 14:06:12 UTC (rev 93254) @@ -222,7 +222,6 @@ this.frame1 = new Gtk.Frame(); this.frame1.Name = "frame1"; this.frame1.ShadowType = ((Gtk.ShadowType)(0)); - this.frame1.LabelXalign = 0F; // Container child frame1.Gtk.Container+ContainerChild this.alignment1 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F); this.alignment1.Name = "alignment1"; Modified: branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic =================================================================== --- branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic 2008-01-18 14:05:26 UTC (rev 93253) +++ branches/monodevelop/main/1.0/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic 2008-01-18 14:06:12 UTC (rev 93254) @@ -81,8 +81,6 @@ <widget class="Gtk.ScrolledWindow" id="scrolledwindow2"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">EtchedIn</property> <child> <widget class="Gtk.TreeView" id="tree"> @@ -487,8 +485,6 @@ <widget class="Gtk.ScrolledWindow" id="scrolled"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <child> <widget class="Gtk.Viewport" id="GtkViewport"> <property name="MemberName" /> @@ -588,7 +584,6 @@ <child> <widget class="Gtk.Frame" id="frame2"> <property name="MemberName" /> - <property name="LabelXalign">0</property> <property name="LabelYalign">0</property> <child> <widget class="Gtk.Label" id="lbl_template_descr"> @@ -900,9 +895,6 @@ </packing> </child> </widget> - <packing> - <property name="TabExpand">False</property> - </packing> </child> <child> <widget class="Gtk.Label" id="label1"> @@ -960,7 +952,6 @@ </widget> <packing> <property name="Position">1</property> - <property name="TabExpand">False</property> </packing> </child> <child> @@ -1839,8 +1830,6 @@ <widget class="Gtk.ScrolledWindow" id="scrolledwindow"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">In</property> <child> <widget class="Gtk.TreeView" id="keyTreeView"> @@ -2765,8 +2754,6 @@ <child> <widget class="Gtk.ScrolledWindow" id="scrolledwindow2"> <property name="MemberName" /> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">In</property> <child> <widget class="Gtk.TextView" id="tipTextview"> @@ -3007,8 +2994,6 @@ <child> <widget class="Gtk.ScrolledWindow" id="scrolledwindow4"> <property name="MemberName" /> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">EtchedOut</property> <child> <widget class="Gtk.TreeView" id="toolListBox"> @@ -3556,7 +3541,7 @@ </widget> </child> </widget> - <widget class="Gtk.Dialog" id="MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog" design-size="642 309"> + <widget class="Gtk.Dialog" id="MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog" design-size="642 313"> <property name="MemberName" /> <property name="GeneratePublic">False</property> <property name="Title">Replace</property> @@ -4691,7 +4676,6 @@ <widget class="Gtk.Frame" id="frame1"> <property name="MemberName" /> <property name="ShadowType">None</property> - <property name="LabelXalign">0</property> <child> <widget class="Gtk.Alignment" id="alignment1"> <property name="MemberName" /> @@ -5187,9 +5171,6 @@ <property name="Yalign">0</property> <property name="LabelProp">label7</property> </widget> - <packing> - <property name="TabExpand">False</property> - </packing> </child> <child> <widget class="Gtk.Label" id="label6"> @@ -5376,8 +5357,6 @@ <property name="MemberName" /> <property name="WidthRequest">100</property> <property name="HeightRequest">100</property> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">In</property> <child> <widget class="Gtk.TreeView" id="IncludeFileListView"> @@ -5774,8 +5753,6 @@ <widget class="Gtk.ScrolledWindow" id="scrolledwindow1"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">In</property> <child> <widget class="Gtk.TreeView" id="catView"> @@ -5798,8 +5775,6 @@ <widget class="MonoDevelop.Components.IconView" id="iconView"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="VscrollbarPolicy">Automatic</property> - <property name="HscrollbarPolicy">Automatic</property> <property name="ShadowType">In</property> </widget> <packing> @@ -5817,7 +5792,6 @@ <widget class="Gtk.Frame" id="frame1"> <property name="MemberName" /> <property name="ShadowType">In</property> - <property name="LabelXalign">0</property> <child> <widget class="Gtk.Alignment" id="GtkAlignment2"> <property name="MemberName" /> _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches