3 using System
.Diagnostics
;
4 using System
.Collections
;
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
);
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 ();
53 public override void Open ()
55 base.OpenFromUri (Hit
["dc:identifier"]);