Forgot to bump FSQ version. Weekend syndrome.
[beagle.git] / search / Tiles / Calendar.cs
blob238fff6a5491879b8a8ce6f55b05d74741feda3b
1 using System;
2 using Mono.Unix;
4 namespace Search.Tiles {
6 public class CalendarActivator : TileActivator {
8 public CalendarActivator () : base ()
10 AddSupportedFlavor (new HitFlavor (null, "Calendar", null));
13 public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query)
15 return new Calendar (hit, query);
19 public class Calendar : TileTemplate {
21 public Calendar (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
23 string summary = hit.GetFirstProperty ("fixme:summary");
24 string time = Utils.NiceShortDate (hit.GetFirstProperty ("fixme:starttime"));
25 Title = (time == "") ? summary : time + ": " + summary;
26 Description = hit.GetFirstProperty ("fixme:description");
29 protected override void LoadIcon (Gtk.Image image, int size)
31 image.Pixbuf = WidgetFu.LoadThemeIcon ("stock_calendar", size);
34 protected override DetailsPane GetDetails ()
36 DetailsPane details = new DetailsPane ();
38 details.AddLabelPair (Catalog.GetString ("Title:"),
39 Title,
40 0, 1);
41 details.AddLabelPair (Catalog.GetString ("Description:"),
42 Description,
43 1, 1);
44 details.AddSnippet (2, 1);
46 return details;