[Monodevelop-patches-list] r1459 - in trunk/MonoDevelop/src/Main/Base: . Gui/BrowserDisplayBinding Gui/Components/StatusBar

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Apr 13 18:18:34 EDT 2004


Author: jluke
Date: 2004-04-13 18:18:34 -0400 (Tue, 13 Apr 2004)
New Revision: 1459

Modified:
   trunk/MonoDevelop/src/Main/Base/ChangeLog
   trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Components/StatusBar/SdStatusBar.cs
Log:
use the StatusBarService


Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-04-13 22:04:42 UTC (rev 1458)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-04-13 22:18:34 UTC (rev 1459)
@@ -6,7 +6,8 @@
 
 2004-04-13  John Luke  <jluke at cfl.rr.com>
 
-	* Gui/BrowserDisplayBinding/HtmlViewPane.cs: use Navbar control
+	* Gui/BrowserDisplayBinding/HtmlViewPane.cs: use Navbar control,
+	use StatusBarService for messages and a Progress monitor
 
 2004-04-11  Todd Berman  <tberman at sevenl.net>
 

Modified: trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs	2004-04-13 22:04:42 UTC (rev 1458)
+++ trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs	2004-04-13 22:18:34 UTC (rev 1459)
@@ -14,6 +14,7 @@
 using MonoDevelop.Core.Services;
 using MonoDevelop.Core.AddIns.Codons;
 using MonoDevelop.Gui;
+using MonoDevelop.Gui.Components;
 using MonoDevelop.Gui.Widgets;
 using MonoDevelop.Gui.HtmlControl;
 using MonoDevelop.Services;
@@ -134,12 +135,13 @@
 	public class HtmlViewPane : Gtk.Frame
 	{
 		MozillaControl htmlControl = null;
+		IStatusBarService statusbarService = (IStatusBarService) ServiceManager.Services.GetService (typeof (IStatusBarService));
+		SdStatusBar status;
 		
 		VBox topPanel = new VBox (false, 2);
 		Navbar nav = new Navbar ();
-		Statusbar status;
 		
-		bool isHandleCreated = false;
+		bool loading = false;
 		static GLib.GType gtype;
 		
 		public MozillaControl MozillaControl {
@@ -162,6 +164,7 @@
 		{
 			Shadow = Gtk.ShadowType.In;
 			VBox mainbox = new VBox (false, 2);
+			status = (SdStatusBar) statusbarService.ProgressMonitor;
 			
 			if (showNavigation) {
 				
@@ -182,11 +185,6 @@
 			htmlControl.ShowAll ();
 			
 			mainbox.PackStart (htmlControl);
-
-			status = new Statusbar ();
-			status.HasResizeGrip  = false;
-			mainbox.PackStart (status, false, true, 0);
-			
 			this.Add (mainbox);
 			this.ShowAll ();
 		}
@@ -198,7 +196,6 @@
 		
 		public void CreatedWebBrowserHandle(object sender, EventArgs evArgs) 
 		{
-			isHandleCreated = true;
 		}
 		
 		public void Navigate(string name)
@@ -209,12 +206,26 @@
 
 		private void OnNetStart (object o, EventArgs args)
 		{
-			status.Push (1, GettextCatalog.GetString ("Loading..."));
+			statusbarService.SetMessage (GettextCatalog.GetString ("Loading..."));
+			loading = true;
+			GLib.Idle.Add (new GLib.IdleHandler (Pulse));
 		}
 
+		bool Pulse ()
+		{
+			if (loading) {
+				status.Pulse ();
+				System.Threading.Thread.Sleep (100);
+				return true;
+			}
+			status.Done ();
+			statusbarService.SetMessage (GettextCatalog.GetString ("Done."));
+			return false;
+		}
+
 		private void OnNetStop (object o, EventArgs args)
 		{
-			status.Push (1, GettextCatalog.GetString ("Done."));
+			loading = false;
 		}
 
 		void OnLocationChanged (object o, EventArgs args)

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/StatusBar/SdStatusBar.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/StatusBar/SdStatusBar.cs	2004-04-13 22:04:42 UTC (rev 1458)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/StatusBar/SdStatusBar.cs	2004-04-13 22:18:34 UTC (rev 1459)
@@ -102,7 +102,7 @@
 			SetMessage (name);
 			this.Progress.Visible = true;
 		}
-		
+
 		public void Worked (double work, string status)
 		{
 			this.Progress.Fraction = work;
@@ -112,6 +112,7 @@
 		public void Done ()
 		{
 			txtStatusBarPanel.Pop (ctx);
+			this.Progress.Fraction = 0.0;
 			this.Progress.Visible = false;
 		}
 




More information about the Monodevelop-patches-list mailing list