Random Dashboard Fixes



Just the result of a morning of fiddling trying to get more of
Dashboard working. Nothing specific really, just bounds checking on
some crashers, and the use of beagle for IMLog's.

--
Cheers,
Kevin Kubasik
http://blog.kubasik.net/
? dashboard-beagle.patch
? status-offline.png
? backends/BeagleBackend.dll.mdb
? backends/BugzillaBackend.dll.mdb
? backends/GaimLogBackend.dll.mdb
? backends/GeoSitesBackend.dll.mdb
? backends/RSSBackend.dll.mdb
? backends/TextChainerBackend.dll.mdb
? engine/dashboard.exe.mdb
? index/html-indexer.exe.mdb
? index/index-manager.dll.mdb
? index/index-viewer.exe.mdb
? index/text-indexer.exe.mdb
? renderers/BugzillaBugMatchRenderer.dll.mdb
? renderers/ContactMatchRenderer.dll.mdb
? renderers/DefaultMatchRenderer.dll.mdb
? renderers/FileMatchRenderer.dll.mdb
? renderers/IMLogMatchRenderer.dll.mdb
? renderers/MailMessageMatchRenderer.dll.mdb
? renderers/RSSMatchRenderer.dll.mdb
? renderers/WebLinkMatchRenderer.dll.mdb
? util/drive/drive.dll.mdb
? util/evolution/evolution.dll.mdb
? util/geo/geo.dll.mdb
? util/geo/test.exe.mdb
? util/rdf/rdf.dll.mdb
? util/rdf/test.exe.mdb
? util/webservices/AmazonSearchService.dll.mdb
? util/webservices/GoogleSearchService.dll.mdb
Index: backends/BeagleBackend.cs
===================================================================
RCS file: /cvs/gnome/dashboard/backends/BeagleBackend.cs,v
retrieving revision 1.12
diff -u -r1.12 BeagleBackend.cs
--- backends/BeagleBackend.cs	16 Mar 2006 22:24:26 -0000	1.12
+++ backends/BeagleBackend.cs	20 Mar 2006 13:37:46 -0000
@@ -73,14 +73,21 @@
 				break;
 
 			case "MailMessage":
-				match ["Subject"] = match ["dc:title"];
+				match ["Subject"] = match ["parent:dc:title"];
 				match ["Icon"] = "internal:mail.png";
-				match ["Flags"] = match ["fixme:flags"];
-				match ["SentDate"] = match ["fixme:date"];
-				match ["To"] = match ["fixme:to"];
-				match ["From"] = match ["fixme:from"];
+				match ["Flags"] = match ["parent:fixme:flags"];
+				match ["SentDate"] = match ["parent:fixme:date"];
+				match ["To"] = match ["parent:fixme:to"];
+				match ["From"] = match ["parent:fixme:from"];
 				break;
-
+				
+			case "IMLog":
+				match ["Alias"] = match["fixme:speakingto_alias"];
+				match ["Icon"] = match["fixme:speakingto_icon"];
+				match ["Date"] = match["fixme:starttime"];
+				match ["Client"] = match["fixme:client"];
+				break;
+				
 			case "Contact":
 				if (hit["Photo"] != null)
 					match ["Photo"] = hit["Photo"];
@@ -112,7 +119,7 @@
 				if (this.hits == null)
 					this.hits = new ArrayList ();
 
-				if (this.hits.Count < 10) {
+				if (this.hits.Count < 25) {
 					this.hits.Add (hit);
 				} else if (!this.finished) {
 					lock (this.lock_obj)
Index: backends/BugzillaBackend.cs
===================================================================
RCS file: /cvs/gnome/dashboard/backends/BugzillaBackend.cs,v
retrieving revision 1.27
diff -u -r1.27 BugzillaBackend.cs
--- backends/BugzillaBackend.cs	27 Apr 2004 20:37:54 -0000	1.27
+++ backends/BugzillaBackend.cs	20 Mar 2006 13:37:46 -0000
@@ -20,7 +20,7 @@
 
 	class BugzillaBackend : BackendSimple {
 
-		private string bugzilla_host = "http://bugzilla.ximian.com";;
+		private string bugzilla_host = "http://bugzilla.gnome.org";;
 
 		public override bool Startup ()
 		{
@@ -35,7 +35,7 @@
 					Console.WriteLine ("The GConf Bugzilla host key is empty !");
 			}
 			catch (GConf.NoSuchKeyException) {
-				client.Set ("/apps/dashboard/backends/bugzilla/host","http://bugzilla.ximian.com";);
+				client.Set ("/apps/dashboard/backends/bugzilla/host","http://bugzilla.gnome.org";);
 				Console.WriteLine ("Setting default Bugzilla host");
 			}
 			
Index: backends/Makefile.am
===================================================================
RCS file: /cvs/gnome/dashboard/backends/Makefile.am,v
retrieving revision 1.82
diff -u -r1.82 Makefile.am
--- backends/Makefile.am	16 Mar 2006 22:48:53 -0000	1.82
+++ backends/Makefile.am	20 Mar 2006 13:37:47 -0000
@@ -1,6 +1,6 @@
 CSC=mcs -g
 dashboard_exe=../engine/dashboard.exe
-DLLDEPS=$(BASE_DEPENDENCIES_LIBS) $(GCONF_SHARP_LIBS) -r:System.Web -r:$(dashboard_exe) -r:../util/drive/drive.dll -r:../engine/rdf.dll
+DLLDEPS=$(BASE_DEPENDENCIES_LIBS) $(GCONF_SHARP_LIBS) -r:/usr/lib/beagle/UiUtil.dll -r:/usr/lib/beagle/Util.dll -r:System.Web -r:$(dashboard_exe) -r:../util/drive/drive.dll -r:../engine/rdf.dll
 LIBFLAGS=-target:library -L ../util/webservices $(DLLDEPS)
 EXEFLAGS=$(DLLDEPS)
 
Index: engine/gui.cs
===================================================================
RCS file: /cvs/gnome/dashboard/engine/gui.cs,v
retrieving revision 1.50
diff -u -r1.50 gui.cs
--- engine/gui.cs	17 Aug 2004 23:20:30 -0000	1.50
+++ engine/gui.cs	20 Mar 2006 13:37:51 -0000
@@ -207,7 +207,7 @@
 					}
 				}
 			}
-
+			s=GetFile(args.Url);
 			if (s == null) {
 				Console.WriteLine ("Could not obtain image " + args.Url);
 				return;
Index: renderers/FileMatchRenderer.cs
===================================================================
RCS file: /cvs/gnome/dashboard/renderers/FileMatchRenderer.cs,v
retrieving revision 1.7
diff -u -r1.7 FileMatchRenderer.cs
--- renderers/FileMatchRenderer.cs	16 Mar 2006 22:24:27 -0000	1.7
+++ renderers/FileMatchRenderer.cs	20 Mar 2006 13:37:54 -0000
@@ -121,7 +121,9 @@
 			xw.WriteEndElement ();	// img
 			xw.WriteEndElement ();	// a
 			xw.WriteEndElement ();	// td
-
+			
+			//Console.WriteLine(Icon);
+			
 			xw.WriteStartElement ("td");
 			xw.WriteAttributeString ("valign", "top");
 			xw.WriteAttributeString ("align", "left");
Index: renderers/IMLogMatchRenderer.cs
===================================================================
RCS file: /cvs/gnome/dashboard/renderers/IMLogMatchRenderer.cs,v
retrieving revision 1.7
diff -u -r1.7 IMLogMatchRenderer.cs
--- renderers/IMLogMatchRenderer.cs	4 Mar 2004 07:32:54 -0000	1.7
+++ renderers/IMLogMatchRenderer.cs	20 Mar 2006 13:37:54 -0000
@@ -9,7 +9,7 @@
 
 using System;
 using System.Collections;
-
+using Beagle.Util;
 [assembly:Dashboard.MatchRendererFactory ("Dashboard.IMLogMatchRenderer")]
 
 namespace Dashboard {
@@ -49,7 +49,7 @@
 					html += HTMLRenderHeader (m);
 
 				html += HTMLRenderSingleIMConv (m);
-
+				//Console.WriteLine(m["Icon"]);
 				current_alias = alias;
 			}
 
@@ -61,16 +61,28 @@
 		private string HTMLRenderHeader (Match m)
 		{
 			string html;
-
-			html = String.Format ("<table border=0 width=100%>"                             +
-					      "    <tr bgcolor=#ecd953>"                                +
-					      "        <td> <img border=0 src=\"{0}\"> </td>"           +
-					      "        <td valign=center>"                              +
-					      "            <font size=+1>Conversations with {1}</font>" +
-					      "        </td>"                                           +
-					      "    </tr>",
-					      m ["Icon"],
-					      m ["Alias"]);
+			if(m["Icon"] != null && !(m["Icon"].Equals(""))){
+				html = String.Format ("<table border=0 width=100%>"                             +
+						      "    <tr bgcolor=#ecd953>"                                +
+						      "        <td> <img border=0 src=\"{0}\"> </td>"           +
+						      "        <td valign=center>"                              +
+						      "            <font size=+1>Conversations with {1}</font>" +
+						      "        </td>"                                           +
+						      "    </tr>",
+						      m ["Icon"],
+						      m ["Alias"]);
+			}
+			else{
+				html = String.Format ("<table border=0 width=100%>"                             +
+						      "    <tr bgcolor=#ecd953>"                                +
+						      "        <td> <img border=0 src=\"{0}\"> </td>"           +
+						      "        <td valign=center>"                              +
+						      "            <font size=+1>Conversations with {1}</font>" +
+						      "        </td>"                                           +
+						      "    </tr>",
+						      "./status-offline.png",//FIXME
+						      m ["Alias"]);
+			}
 
 			return html;
 		}
@@ -84,7 +96,7 @@
 					      "        <a style=\"text-decoration: none;\" href=\"{1}\">{0}</a>"        +
 					      "    </font></td>"                                                        +
 					      "</tr>",
-					      m ["Date"],
+					      Beagle.Util.StringFu.DateTimeToPrettyString(Beagle.Util.StringFu.StringToDateTime((string)m ["Date"])),
 					      m ["URL"]);
 
 			return html;
Index: renderers/MailMessageMatchRenderer.cs
===================================================================
RCS file: /cvs/gnome/dashboard/renderers/MailMessageMatchRenderer.cs,v
retrieving revision 1.10
diff -u -r1.10 MailMessageMatchRenderer.cs
--- renderers/MailMessageMatchRenderer.cs	16 Mar 2006 22:24:27 -0000	1.10
+++ renderers/MailMessageMatchRenderer.cs	20 Mar 2006 13:37:54 -0000
@@ -81,11 +81,16 @@
 
 		public static DateTime UInt64ToDateTime (UInt64 evodate)
 		{
+			DateTime ret;
 			// FIXME: This is disgusting. there should be (and probably is) a class to do this
-			DateTime ret = new DateTime ((int) (evodate / 10000000000), (int) (evodate / 100000000 % 100), 
+			if(evodate > 0){
+				ret = new DateTime ((int) (evodate / 10000000000), (int) (evodate / 100000000 % 100),
 						     (int) (evodate / 1000000 % 100), (int) (evodate / 10000 % 100), 
 						     (int) (evodate / 100 % 100), (int) (evodate % 100.0));
-
+			}
+			else{
+				ret = DateTime.Now; //FIXME: Just to keep from crashing, not a good solution.
+			}
 			return ret;
 		}
 
@@ -93,9 +98,9 @@
 		{
 			// Make the date look pretty
 			System.DateTime date = UInt64ToDateTime (Convert.ToUInt64 (m ["SentDate"]));
-			Console.WriteLine ("blah");
+			//Console.WriteLine ("blah");
 			string maildate = date.ToString ();
-			Console.WriteLine ("blah");
+			//Console.WriteLine ("blah");
 			string ParsedDate = ParseMailDate (maildate);
 
 			Message msg = new Message ();
@@ -109,7 +114,7 @@
 				xw.WriteAttributeString ("bgcolor", "#eeeeee");
 
 			xw.WriteStartElement ("a");
-			xw.WriteAttributeString ("href", "exec:evolution-1.5 " + m ["URI"]); // FIXME: Probably unsafe
+			xw.WriteAttributeString ("href", "exec:evolution " + m ["URI"]); // FIXME: Probably unsafe
 			xw.WriteAttributeString ("style", "text-decoration: none; color: black;");
 
 			// new / read / replied-to icon
Index: renderers/Makefile.am
===================================================================
RCS file: /cvs/gnome/dashboard/renderers/Makefile.am,v
retrieving revision 1.12
diff -u -r1.12 Makefile.am
--- renderers/Makefile.am	3 Mar 2005 00:09:30 -0000	1.12
+++ renderers/Makefile.am	20 Mar 2006 13:37:54 -0000
@@ -1,6 +1,6 @@
 CSC=mcs -g
 dashboard_exe=../engine/dashboard.exe
-DLLDEPS= -r:$(dashboard_exe) -pkg:gtk-sharp
+DLLDEPS= -r:$(dashboard_exe) -r:/usr/lib/beagle/UiUtil.dll -pkg:gtk-sharp
 LIBFLAGS=-target:library $(DLLDEPS)
 EXEFLAGS=$(DLLDEPS)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]