Forgot to bump FSQ version. Weekend syndrome.
[beagle.git] / search / Tiles / WebHistory.cs
blob2685d88a781a2a7bb89182e2972ad561d75820ef
1 using System;
2 using Mono.Unix;
4 namespace Search.Tiles {
6 public class WebHistoryActivator : TileActivator {
8 public WebHistoryActivator () : base ()
10 AddSupportedFlavor (new HitFlavor (null, "WebHistory", null));
13 public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query)
15 return new WebHistory (hit, query);
20 public class WebHistory : TileTemplate {
22 public WebHistory (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
24 Group = TileGroup.Website;
25 Title = hit.GetFirstProperty ("dc:title");
26 Description = hit.Uri.ToString ();
29 // We intentionally use a separate thumbnailer/thread from Tiles.File,
30 // because the web thumbnailer is much slower and we don't want it to
31 // hold up the image/document thumbnails
33 static ThumbnailFactory thumbnailer = new ThumbnailFactory ();
35 protected override void LoadIcon (Gtk.Image image, int size)
37 if (!thumbnailer.SetThumbnailIcon (image, Hit, size))
38 base.LoadIcon (image, size);
41 public override void Open ()
43 base.OpenFromMime (Hit);
46 protected override DetailsPane GetDetails ()
48 DetailsPane details = new DetailsPane ();
50 details.AddLabelPair (Catalog.GetString ("Title:"),
51 Title,
52 0, 1);
53 details.AddLabelPair (Catalog.GetString ("URL:"),
54 Hit.Uri.ToString (),
55 1, 1);
56 details.AddLabelPair (Catalog.GetString ("Accessed:"),
57 Utils.NiceLongDate (Timestamp),
58 2, 1);
60 details.AddSnippet (3, 1);
62 return details;