Dashboard Compile & Render Fixes
- From: Matt Jones <mattharrison sbcglobal net>
- To: dashboard-hackers gnome org
- Subject: Dashboard Compile & Render Fixes
- Date: Wed, 15 Mar 2006 14:16:13 -0800
Hi -
I fixed up dashboard so that it builds again. Most of the fixes involved
replacing dashboard's gnome bindings with those from official *-sharp
packages, updating -sharp packages to -sharp-2.0 packages, and updating
the beagle api.
I've tested the beagle backend with the file and email renderers.
The path to the beagle UiUtil dll (for some gnome convenience functions)
is hardcoded to /usr/lib/beagle/UiUtil (as it's not exposed in a pkg
config file).
This wasn't really intended as a final solution - I'm actually in the
process of rewriting dashboard to use the beagle-search UI, use beagle
as a sole backend, and respond via d-bus rather than a tcp port. I might
have a prototype available somewhere (probably gnomecvs) possibly this
weekend.
I was curious - what features did people find really useful about
dashboard / what did they find annoying? Personally, the clue-chaining
was really cool (i have some ideas on improving this i want to try out),
which is the main reason I'm working on this.
Thanks,
--Matt Jones
? 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: configure.in
===================================================================
RCS file: /cvs/gnome/dashboard/configure.in,v
retrieving revision 1.24
diff -u -p -r1.24 configure.in
--- configure.in 17 Jun 2004 04:25:03 -0000 1.24
+++ configure.in 15 Mar 2006 02:03:43 -0000
@@ -23,11 +23,11 @@ if test "x$MCSTEST" = "xno"; then
fi
GTK_SHARP_REQUIRED_VERSION=0.10
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, gtk-sharp >= $GTK_SHARP_REQUIRED_VERSION \
- gnome-sharp gtkhtml-sharp)
+PKG_CHECK_MODULES(BASE_DEPENDENCIES, gtk-sharp-2.0 >= $GTK_SHARP_REQUIRED_VERSION \
+ gnome-sharp-2.0 gtkhtml-sharp-2.0)
AC_SUBST(BASE_DEPENDENCIES_LIBS)
-PKG_CHECK_MODULES(GCONF_SHARP, gconf-sharp)
+PKG_CHECK_MODULES(GCONF_SHARP, gconf-sharp-2.0)
AC_SUBST(GCONF_SHARP_LIBS)
BEAGLE_REQUIRED_VERSION=0.0
Index: backends/BeagleBackend.cs
===================================================================
RCS file: /cvs/gnome/dashboard/backends/BeagleBackend.cs,v
retrieving revision 1.11
diff -u -p -r1.11 BeagleBackend.cs
--- backends/BeagleBackend.cs 3 Mar 2005 00:09:29 -0000 1.11
+++ backends/BeagleBackend.cs 15 Mar 2006 02:03:43 -0000
@@ -47,10 +47,12 @@ namespace Dashboard {
match ["URI"] = url_string;
match ["MimeType"] = hit.MimeType;
match ["Source"] = hit.Source;
- match ["Score"] = hit.Score;
+ match ["Score"] = Convert.ToString (hit.Score);
- foreach (String key in hit.Keys)
- match [key] = hit [key];
+ foreach (Property key in hit.Properties) {
+ Console.WriteLine ("{0} => {1}", key.Key, key.Value);
+ match [key.Key] = key.Value;
+ }
// Type-specific gunk
switch (hit.Type) {
@@ -61,7 +63,7 @@ namespace Dashboard {
match ["Text"] = local_path.Substring (local_path.LastIndexOf ('/') + 1);
Gtk.IconSize size = (Gtk.IconSize) 48;
- string icon = Beagle.Util.GnomeIconLookup.LookupMimeIcon (hit.MimeType, size);
+ string icon = Beagle.Util.GnomeFu.GetMimeIconPath (hit.MimeType);
if (icon == null)
icon = "internal:document.png";
@@ -71,15 +73,18 @@ namespace Dashboard {
break;
case "MailMessage":
- match ["Title"] = match ["Subject"];
+ match ["Subject"] = match ["dc:title"];
match ["Icon"] = "internal:mail.png";
- match ["Flags"] = match ["_Flags"];
+ match ["Flags"] = match ["fixme:flags"];
+ match ["SentDate"] = match ["fixme:date"];
+ match ["To"] = match ["fixme:to"];
+ match ["From"] = match ["fixme:from"];
break;
case "Contact":
- if (hit.GetData ("Photo") != null)
- match ["Photo"] = hit.GetData ("Photo");
- foreach (string key in hit.Keys)
+ if (hit["Photo"] != null)
+ match ["Photo"] = hit["Photo"];
+ foreach (string key in hit.Properties)
match [key] = hit [key];
break;
}
@@ -102,7 +107,7 @@ namespace Dashboard {
this.lock_obj = new Object ();
}
- private void OnHitAdded (Query source, Hit hit)
+ private void OnHitAdded (Hit hit)
{
if (this.hits == null)
this.hits = new ArrayList ();
@@ -115,10 +120,10 @@ namespace Dashboard {
}
}
- private void OnHitsAdded (Query source, ICollection hits)
+ private void OnHitsAdded (Beagle.HitsAddedResponse response)
{
- foreach (Hit hit in hits) {
- OnHitAdded (source, hit);
+ foreach (Hit hit in response.Hits) {
+ OnHitAdded (hit);
}
}
@@ -129,7 +134,7 @@ namespace Dashboard {
this.hits = null;
this.finished = false;
- query = Beagle.Factory.NewQuery ();
+ query = new Beagle.Query ();
query.AddDomain (Beagle.QueryDomain.Neighborhood);
query.AddDomain (Beagle.QueryDomain.Global); // Probably want to make this a setting
@@ -142,7 +147,7 @@ namespace Dashboard {
query.AddText (clue_text);
}
- query.Start ();
+ query.SendAsync ();
return false;
}
Index: backends/Makefile.am
===================================================================
RCS file: /cvs/gnome/dashboard/backends/Makefile.am,v
retrieving revision 1.80
diff -u -p -r1.80 Makefile.am
--- backends/Makefile.am 3 Mar 2005 00:09:29 -0000 1.80
+++ backends/Makefile.am 15 Mar 2006 02:03:43 -0000
@@ -6,8 +6,8 @@ EXEFLAGS=$(DLLDEPS)
# The backends to build by default.
backends = \
- BeagleBackend.dll \
BugzillaBackend.dll \
+ BeagleBackend.dll \
GaimLogBackend.dll \
GeoSitesBackend.dll \
RSSBackend.dll \
@@ -70,8 +70,8 @@ all: $(backends) $(conditional_backends)
%.dll: %.cs $(dashboard_exe)
$(CSC) $(LIBFLAGS) -out:$@ $<
-BeagleBackend.dll: BeagleBackend.cs $(dashboard_exe) $(top_srcdir)/engine/gnome.cs
- $(CSC) $(LIBFLAGS) -out:BeagleBackend.dll $(srcdir)/BeagleBackend.cs $(top_srcdir)/engine/gnome.cs $(BEAGLE_LIBS)
+BeagleBackend.dll: BeagleBackend.cs $(dashboard_exe) #$(top_srcdir)/engine/gnome.cs
+ $(CSC) $(LIBFLAGS) -out:BeagleBackend.dll $(srcdir)/BeagleBackend.cs $(BEAGLE_LIBS) -r:/usr/lib/beagle/UiUtil.dll #$(top_srcdir)/engine/gnome.cs
EvolutionAddressbookBackend.dll: EvolutionAddressbookBackend.cs $(dashboard_exe)
$(CSC) $(LIBFLAGS) -out:EvolutionAddressbookBackend.dll $(srcdir)/EvolutionAddressbookBackend.cs $(evosharp_flags)
Index: engine/Makefile.am
===================================================================
RCS file: /cvs/gnome/dashboard/engine/Makefile.am,v
retrieving revision 1.52
diff -u -p -r1.52 Makefile.am
--- engine/Makefile.am 3 Mar 2005 00:09:30 -0000 1.52
+++ engine/Makefile.am 15 Mar 2006 02:03:43 -0000
@@ -33,7 +33,6 @@ DASHBOARD_CSFILES = \
$(srcdir)/CluePacket.cs \
$(srcdir)/CluePacketManager.cs \
$(srcdir)/dashboard.cs \
- $(srcdir)/gnome.cs \
$(srcdir)/gui.cs \
$(srcdir)/Server.cs \
$(srcdir)/TcpServer.cs \
@@ -44,6 +43,7 @@ DASHBOARD_CSFILES = \
$(srcdir)/Grapher.cs \
$(srcdir)/BackendResult.cs \
$(srcdir)/MatchRendererFactoryAttribute.cs
+# $(srcdir)/gnome.cs \
all: dashboard.exe
@@ -52,7 +52,7 @@ dashboard.exe: $(DASHBOARD_CSFILES) $(sr
test-ebook.exe: $(srcdir)/test-ebook.cs
- $(CSC) -g -out:test-ebook.exe $(srcdir)/test-ebook.cs -pkg:gnome-sharp -r:System.Drawing
+ $(CSC) -g -out:test-ebook.exe $(srcdir)/test-ebook.cs -pkg:gnome-sharp-2.0 -r:System.Drawing
clean:
rm -f *.dbg *.exe *.dll
Index: engine/Match.cs
===================================================================
RCS file: /cvs/gnome/dashboard/engine/Match.cs,v
retrieving revision 1.23
diff -u -p -r1.23 Match.cs
--- engine/Match.cs 17 Feb 2004 02:44:16 -0000 1.23
+++ engine/Match.cs 15 Mar 2006 02:03:43 -0000
@@ -59,7 +59,7 @@ namespace Dashboard {
if (!this.properties.Contains (name))
return null;
- return this.properties [name];
+ return (string)this.properties [name];
}
set {
Index: renderers/FileMatchRenderer.cs
===================================================================
RCS file: /cvs/gnome/dashboard/renderers/FileMatchRenderer.cs,v
retrieving revision 1.6
diff -u -p -r1.6 FileMatchRenderer.cs
--- renderers/FileMatchRenderer.cs 15 May 2004 02:40:12 -0000 1.6
+++ renderers/FileMatchRenderer.cs 15 Mar 2006 02:03:43 -0000
@@ -75,10 +75,11 @@ namespace Dashboard {
private void HTMLRenderSingleFile (Match m, bool color_band, XmlWriter xw)
{
- string Path = Convert.ToString (m ["Path"]);
- string Text = Convert.ToString (m ["Text"]);
- string Icon = Convert.ToString (m ["Icon"]);
- string Score = Convert.ToString (m ["Score"]);
+ string Path = ((string)(m ["Path"]));
+ string Text = ((string)m ["Text"]);
+ string Icon = ((string)m ["Icon"]);
+ string Score = ((string)m ["Score"]);
+ System.Console.WriteLine ("Path: {0}", Path);
if (Score == null || Score == "")
Score = "0";
Index: renderers/MailMessageMatchRenderer.cs
===================================================================
RCS file: /cvs/gnome/dashboard/renderers/MailMessageMatchRenderer.cs,v
retrieving revision 1.9
diff -u -p -r1.9 MailMessageMatchRenderer.cs
--- renderers/MailMessageMatchRenderer.cs 15 May 2004 02:40:12 -0000 1.9
+++ renderers/MailMessageMatchRenderer.cs 15 Mar 2006 02:03:43 -0000
@@ -79,10 +79,23 @@ namespace Dashboard {
return sw.ToString ();
}
+ public static DateTime UInt64ToDateTime (UInt64 evodate)
+ {
+ // 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),
+ (int) (evodate / 1000000 % 100), (int) (evodate / 10000 % 100),
+ (int) (evodate / 100 % 100), (int) (evodate % 100.0));
+
+ return ret;
+ }
+
private void HTMLRenderSingleMailMessage (Match m, bool color_band, XmlWriter xw)
{
// Make the date look pretty
- string maildate = Convert.ToString (m ["SentDate"]);
+ System.DateTime date = UInt64ToDateTime (Convert.ToUInt64 (m ["SentDate"]));
+ Console.WriteLine ("blah");
+ string maildate = date.ToString ();
+ Console.WriteLine ("blah");
string ParsedDate = ParseMailDate (maildate);
Message msg = new Message ();
@@ -352,13 +365,13 @@ namespace Dashboard {
this.subject = Convert.ToString (m ["Subject"]);
this.sender = Convert.ToString (m ["From"]);
this.recipient = Convert.ToString (m ["To"]);
- this.sentdate = DateTime.Parse (Convert.ToString (m ["SentDate"]));
- this.uid = Convert.ToString (m ["UID"]);
+ this.sentdate = MailMessageMatchRenderer.UInt64ToDateTime (Convert.ToUInt64 (m ["SentDate"]));
+ this.uid = "";//Convert.ToString (m ["UID"]);
- // this.sendername = this.sender.Substring (0, (this.sender.LastIndexOf ("<") - 1));
+ //this.sendername = this.sender.Substring (0, (this.sender.LastIndexOf ("<") - 1));
// Parse the message flags
- int flags = int.Parse (Convert.ToString (m ["Flags"]));
+ int flags = 0;//int.Parse (Convert.ToString (m ["Flags"]));
if ((flags & (int) CamelFlags.ANSWERED) == (int) CamelFlags.ANSWERED)
this.hasreply = true;
@@ -412,8 +425,15 @@ namespace Dashboard {
Match matchX = (Match) x;
Match matchY = (Match) y;
- DateTime DateX = DateTime.Parse (Convert.ToString (matchX ["SentDate"]));
- DateTime DateY = DateTime.Parse (Convert.ToString (matchY ["SentDate"]));
+ UInt64 mx = Convert.ToUInt64 (matchX ["SentDate"]);
+ UInt64 my = Convert.ToUInt64 (matchY ["SentDate"]);
+
+ // System.Console.WriteLine ("Comparing {0} and {1}", mx, my);
+
+ DateTime DateX = MailMessageMatchRenderer.UInt64ToDateTime (mx);
+ DateTime DateY = MailMessageMatchRenderer.UInt64ToDateTime (my);
+
+ // System.Console.WriteLine ("Comparing {0} and {1}", DateX, DateY);
if (matchX == null && matchY == null) {
return 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]