5
namespace Beagle.Search.Tiles {
7
public class TaskActivator : TileActivator {
9
public TaskActivator () : base ()
11
AddSupportedFlavor (new HitFlavor (null, "Task", null));
14
public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query)
16
return new Task (hit, query);
20
public class Task : TileTemplate {
22
public Task (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
24
Group = TileGroup.Calendar;
26
Title = hit.GetFirstProperty ("fixme:summary");
28
if (!String.IsNullOrEmpty (hit.GetFirstProperty ("fixme:description")))
29
Description = Utils.TrimFirstLine (hit.GetFirstProperty ("fixme:description"));
32
protected override void LoadIcon (Gtk.Image image, int size)
34
image.Pixbuf = WidgetFu.LoadThemeIcon ("stock_todo", size);
37
protected override DetailsPane GetDetails ()
39
DetailsPane details = new DetailsPane ();
41
details.AddLabelPair (Catalog.GetString ("Title:"), Title);
43
if (!String.IsNullOrEmpty (Description))
44
details.AddLabelPair (Catalog.GetString ("Description:"), Description);
46
if (!String.IsNullOrEmpty (Hit.GetFirstProperty ("fixme:starttime")))
47
details.AddLabelPair (Catalog.GetString ("Date:"), Utils.NiceShortDate (Hit.GetFirstProperty ("fixme:starttime")));
52
public override void Open ()
54
SafeProcess p = new SafeProcess ();
55
p.Arguments = new string [] { "evolution", Hit.EscapedUri };
59
} catch (SafeProcessException e) {
60
Console.WriteLine (e.Message);