Show total number of results for google driver too. Helps to know if my query resulte...
[beagle.git] / search / Tiles / RSSFeed.cs
blob7841e80b89fe93e48eb030e163f224829d49a65d
1 using System;
2 using System.IO;
3 using System.Diagnostics;
4 using System.Collections;
5 using Mono.Unix;
7 namespace Search.Tiles {
9 public class RSSFeedActivator : TileActivator {
11 public RSSFeedActivator () : base ()
13 AddSupportedFlavor (new HitFlavor (null, "FeedItem", null));
16 public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query)
18 return new RSSFeed (hit, query);
22 public class RSSFeed : TileTemplate {
24 public RSSFeed (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
26 Group = TileGroup.Feed;
28 Title = Hit ["dc:title"];
29 Description = Hit ["dc:publisher"];
32 protected override void LoadIcon (Gtk.Image image, int size)
34 string path = Hit ["fixme:cachedimg"];
35 if (path != null && File.Exists (path))
36 image.Pixbuf = new Gdk.Pixbuf (path, size, size);
37 else
38 image.Pixbuf = WidgetFu.LoadThemeIcon ("gnome-fs-bookmark", size); // FIXME: RSS icon?
41 protected override DetailsPane GetDetails ()
43 DetailsPane details = new DetailsPane ();
45 details.AddLabelPair (Catalog.GetString ("Title:"), Hit ["dc:title"]);
46 details.AddLabelPair (Catalog.GetString ("Site:"), Hit ["dc:identifier"]);
47 details.AddLabelPair (Catalog.GetString ("Date Viewed:"), Utils.NiceLongDate (Timestamp));
48 details.AddSnippet ();
50 return details;
53 public override void Open ()
55 base.OpenFromUri (Hit ["dc:identifier"]);