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
);
38 if (image
.Pixbuf
.Width
> size
|| image
.Pixbuf
.Height
> size
)
39 image
.Pixbuf
= image
.Pixbuf
.ScaleSimple (size
, size
, Gdk
.InterpType
.Bilinear
);
41 image
.Pixbuf
= WidgetFu
.LoadThemeIcon ("gnome-fs-bookmark", size
); // FIXME: RSS icon?
44 protected override DetailsPane
GetDetails ()
46 DetailsPane details
= new DetailsPane ();
48 details
.AddLabelPair (Catalog
.GetString ("Title:"), Hit
["dc:title"]);
49 details
.AddLabelPair (Catalog
.GetString ("Site:"), Hit
["dc:identifier"]);
50 details
.AddLabelPair (Catalog
.GetString ("Date Viewed:"), Utils
.NiceLongDate (Timestamp
));
51 details
.AddSnippet ();
56 public override void Open ()
58 base.OpenFromUri (Hit
["dc:identifier"]);