public static SafeProcess GetClientProcess(Beagle.Hit hit) { string client = null; SafeProcess p = null; if (hit.ParentUri != null) { client = Utils.GetFirstPropertyOfParent(hit, "fixme:client"); } else { client = hit.GetFirstProperty("fixme:client"); } if (client == "evolution") { p = new SafeProcess(); p.Arguments = new string [2]; p.Arguments [0] = "evolution"; p.Arguments [1] = (hit.ParentUri != null ? hit.EscapedParentUri : hit.EscapedUri); } #if ENABLE_THUNDERBIRD else if (client == "thunderbird") { p = Thunderbird.GetSafeProcess("-viewbeagle", hit.GetFirstProperty("fixme:uri")); } #endif return(p); }
public IMLog(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Group = TileGroup.Conversations; Subject.LabelProp = Catalog.GetString("IM Conversation"); string alias = hit.GetFirstProperty("fixme:speakingto_alias"); string name = hit.GetFirstProperty("fixme:speakingto"); if (alias != null && alias != "") { From.LabelProp = "<b>" + alias + "</b>"; } else if (name != null && name != "") { From.LabelProp = "<b>" + name + "</b>"; } else { From.LabelProp = "(unknown)"; } try { string starttime = hit.GetFirstProperty("fixme:starttime"); if (!String.IsNullOrEmpty(starttime)) { Timestamp = StringFu.StringToDateTime(starttime); } Date.LabelProp = Utils.NiceShortDate(Timestamp); } catch {} }
public Task(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Group = TileGroup.Calendar; Title = hit.GetFirstProperty("fixme:summary"); if (!String.IsNullOrEmpty(hit.GetFirstProperty("fixme:description"))) { Description = Utils.TrimFirstLine(hit.GetFirstProperty("fixme:description")); } }
public static string GetFirstPropertyOfParent(Beagle.Hit hit, string prop) { if (hit.ParentUri == null) { return(hit.GetFirstProperty(prop)); } else { return(hit.GetFirstProperty("parent:" + prop)); } }
public Contact(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Group = TileGroup.Contact; Title = hit.GetFirstProperty("fixme:Name"); Description = hit.GetFirstProperty("fixme:Email"); if (Hit.GetFirstProperty("fixme:Email") != null) { AddAction(new TileAction(Catalog.GetString("Send Mail"), SendMail)); } }
protected static string GetTitle(Beagle.Hit hit) { string title; title = hit.GetFirstProperty("dc:title"); if (String.IsNullOrEmpty(title)) { title = hit.GetFirstProperty("beagle:ExactFilename"); } return(title); }
public Calendar(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Group = TileGroup.Calendar; string summary = hit.GetFirstProperty("fixme:summary"); string time = Utils.NiceShortDate(hit.GetFirstProperty("fixme:starttime")); Title = (time == "") ? summary : time + ": " + summary; if (!String.IsNullOrEmpty(hit.GetFirstProperty("fixme:description"))) { Description = Utils.TrimFirstLine(hit.GetFirstProperty("fixme:description")); } }
public override bool Validate(Beagle.Hit hit) { if (!base.Validate(hit)) { return(false); } if (hit ["beagle:HitType"] == "File") { // This handles a case when a file with the // message/rfc822 mimetype is indexed without // gmime. Thus we fail to extract any info and // this tile is useless. string subject = hit.GetFirstProperty("dc:title"); if (subject != null && subject != "") { return(true); } return(false); } return(true); }
public Docbook(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { if (!String.IsNullOrEmpty(hit.GetFirstProperty("dc:title"))) { Title = hit.GetFirstProperty("dc:title"); } else { Title = hit.GetFirstProperty("beagle:ExactFilename"); } if (hit ["beagle:IsChild"] == "true") { Description = hit.GetFirstProperty("parent:beagle:Filename"); } else { Description = hit.GetFirstProperty("beagle:Filename"); } }
public Manpage(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { if (!String.IsNullOrEmpty(hit.GetFirstProperty("dc:title"))) { Title = hit.GetFirstProperty("dc:title"); } else { Title = hit.GetFirstProperty("beagle:ExactFilename"); } if (hit ["beagle:IsChild"] == "true") { path = hit.ParentUri.LocalPath; } else { path = hit.Uri.LocalPath; } Description = hit.GetFirstProperty("dc:subject") ?? Catalog.GetString("Manual page"); }
public TextDocument(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Group = TileGroup.Documents; if (Hit ["fixme:page-count"] != null) { int count = Int32.Parse(Hit ["fixme:page-count"]); Description = String.Format(Catalog.GetPluralString("{0} page", "{0} pages", count), count); } // These files generally have a default title or an auto-generated title. // So use the filename for these types of files. Title = hit.GetFirstProperty("beagle:ExactFilename"); }
public WebHistory(Beagle.Hit hit, Beagle.Query query) : base(hit, query) { Group = TileGroup.Website; string title = hit.GetFirstProperty("dc:title"); if (String.IsNullOrEmpty(title)) { title = Hit.Uri.Host; } Title = title; Description = hit.Uri.ToString(); AddAction(new TileAction("Find more from same host", Gtk.Stock.Find, FindFromHost)); }
public override bool Validate(Beagle.Hit hit) { if (!base.Validate(hit)) { return(false); } string str = hit.GetFirstProperty("fixme:inside_archive"); if (hit.ParentUri == null || str == null || str == "false") { return(false); } Weight += 1; return(true); }