Author: scotte
Date: 2006-08-08 21:14:50 -0400 (Tue, 08 Aug 2006)
New Revision: 63515

Modified:
   trunk/monodevelop/Extras/WelcomePage/ChangeLog
   trunk/monodevelop/Extras/WelcomePage/WelcomePageView.cs
Log:
2006-08-08  Scott Ellington  <[EMAIL PROTECTED]>

        * WelcomePageView.cs: reload when recent solutions list changes


Modified: trunk/monodevelop/Extras/WelcomePage/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/WelcomePage/ChangeLog      2006-08-09 01:06:30 UTC 
(rev 63514)
+++ trunk/monodevelop/Extras/WelcomePage/ChangeLog      2006-08-09 01:14:50 UTC 
(rev 63515)
@@ -1,5 +1,9 @@
 2006-08-08  Scott Ellington  <[EMAIL PROTECTED]>
 
+       * WelcomePageView.cs: reload when recent solutions list changes
+
+2006-08-08  Scott Ellington  <[EMAIL PROTECTED]>
+
        * WelcomePage.xsl: provide better development links
 
 2006-07-28 Matej Urbas <[EMAIL PROTECTED]>

Modified: trunk/monodevelop/Extras/WelcomePage/WelcomePageView.cs
===================================================================
--- trunk/monodevelop/Extras/WelcomePage/WelcomePageView.cs     2006-08-09 
01:06:30 UTC (rev 63514)
+++ trunk/monodevelop/Extras/WelcomePage/WelcomePageView.cs     2006-08-09 
01:14:50 UTC (rev 63515)
@@ -49,6 +49,8 @@
                protected Frame control;
                protected MozillaControl htmlControl;
                
+               string datadir;
+               
                public override Gtk.Widget Control {
                        get {
                                return control;
@@ -73,13 +75,17 @@
                        htmlControl.OpenUri += new OpenUriHandler (CatchUri);
                        htmlControl.LinkMsg += new EventHandler (LinkMessage);
                        
-                       //START HERE: Move To Thread?
-                       
-                       string datadir = Path.GetDirectoryName 
(typeof(ShowWelcomePageHandler).Assembly.Location) + "/";
-                       //Console.WriteLine(datadir);
-                       
-                       //string datadir = Runtime.Properties.DataDirectory;
+                       datadir = Path.GetDirectoryName 
(typeof(ShowWelcomePageHandler).Assembly.Location) + "/";
 
+                       this.IsViewOnly = true;
+
+                       LoadContent ();
+
+                       IdeApp.Workbench.RecentOpen.RecentProjectChanged += 
RecentChangesHandler;
+               }
+               
+               void LoadContent ()
+               {
                        // build simple xml which XSLT will process into XHTML
                        string myxml =  "<?xml version=\"1.0\" 
encoding=\"ISO-8859-1\"?>" +
                                                        "<WelcomePage>" +
@@ -95,12 +101,15 @@
                        StringWriter fs = new StringWriter();
                        xslt.Transform(inxml, null, fs, null);
 
-                       //Console.WriteLine(fs.ToString());
                        htmlControl.Html = fs.ToString();
                        //Initialize(null);
-                       
-                       this.IsViewOnly = true;
                }
+
+               void RecentChangesHandler ( object sender, EventArgs e )
+               {
+                       LoadContent ();
+                       Initialize (null);
+               }
                
                void LinkMessage (object sender, EventArgs e)
                {
@@ -180,10 +189,16 @@
                public void Initialize(object obj)
                {
                        htmlControl.DelayedInitialize();
-                       //object t = new object();
-                       //htmlControl.Navigate("http://www.google.com";, ref t, 
ref t,ref t,ref t); 
                }
 
+               public override void Dispose ()
+               {
+                       base.Dispose ();
+
+                       IdeApp.Workbench.RecentOpen.RecentProjectChanged -= 
RecentChangesHandler;
+                       htmlControl.Dispose ();
+               }
+               
                public static string TimeSinceEdited(int timestamp)
                {
                        DateTime prjtime = (new DateTime (1970, 1, 1, 0, 0, 0, 
0)).AddSeconds(timestamp);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to