void HandleSpinEdited(object o, EditedArgs args) { TreeIter it; if (bugsStore.GetIterFromString(out it, args.Path)) { int val; if (int.TryParse(args.NewText, out val)) { if (val < 0) { val = 0; } if (val > 10) { val = 10; } BugInfo bi = (BugInfo)bugsStore.GetValue(it, ColBug); if (bi != null) { bugsStore.SetValue(it, ColPriority, val); bi.LocalPriority = val; } } } }
public void OpenBug(BugInfo b) { string url = useSSL ? "https" : "http"; url += "://" + host + "/show_bug.cgi?id=" + b.Id; DesktopService.ShowUrl(url); }
List <BugInfo> GetSelection() { List <BugInfo> bugs = new List <BugInfo> (); foreach (var p in bugsList.Selection.GetSelectedRows()) { TreeIter it; bugsStore.GetIter(out it, p); BugInfo bi = (BugInfo)bugsStore.GetValue(it, ColBug); if (bi != null) { bugs.Add(bi); } } return(bugs); }
protected void OnUpdateTaskList(CommandArrayInfo ci) { BugInfo bug = GetSelection().FirstOrDefault(); foreach (var t in server.Tags) { CommandInfo c = ci.Add(t.Name, t.Name); c.Icon = string.Format("#{0:x2}{1:x2}{2:x2}", t.Color.Red >> 8, t.Color.Green >> 8, t.Color.Blue >> 8); if (bug != null) { c.Checked = bug.HasTag(t.Name); } else { c.Enabled = false; } } }
string GrepGroupValue(BugInfo b) { switch (lastGroupCommand) { case GroupCommand.GroupByComponent: return(b.Component); case GroupCommand.GroupByMilestone: return(b.TargetMilestone); case GroupCommand.GroupByOwner: return(b.Assignee); case GroupCommand.GroupBySeverity: return(b.Severity); case GroupCommand.GroupByStatus: return(b.Status); case GroupCommand.GroupByTag: return(GetTagsString(b)); } return(""); }
bool IsFiltered(BugInfo bi) { if (bi.Status == "NEEDINFO" || bi.Status == "CLOSED" || bi.Status == "RESOLVED" || bi.Status == "VERIFIED") { return(true); } string filter = entryFilter.Text.ToLower(); if (filter.Length > 0) { if (bi.Summary.ToLower().IndexOf(filter) == -1) { if (bi.Comments.All(ci => ci.Text.ToLower().IndexOf(filter) == -1)) { return(true); } } } return(false); }
void AppendBug(TreeIter pi, BugInfo bug) { int age = (int)(DateTime.Now - bug.DateCreated).TotalDays; int we = bug.IsNew ? 700 : 400; object bg; if (bug.LocalPriority <= server.HighPriorityLevel) { bg = HighPrioColor; } else if (bug.LocalPriority <= server.MedPriorityLevel) { bg = MedPrioColor; } else if (bug.LocalPriority <= server.LowPriorityLevel) { bg = LowPrioColor; } else { bg = null; } object fg; if (bug.Tags != null && bug.Tags.Length > 0) { fg = server.GetTagColor(bug.Tags[0]); } else { fg = null; } if (pi.Equals(TreeIter.Zero)) { bugsStore.AppendValues(bug, GrepGroupValue(bug), bug.Id, bug.LocalPriority, bug.Status, bug.Severity, bug.TargetMilestone, age, bug.Assignee, bug.OperatingSystem, bug.Component, bug.Summary, we, bg, fg, GetTagsString(bug)); } else { bugsStore.AppendValues(pi, bug, GrepGroupValue(bug), bug.Id, bug.LocalPriority, bug.Status, bug.Severity, bug.TargetMilestone, age, bug.Assignee, bug.OperatingSystem, bug.Component, bug.Summary, we, bg, fg, GetTagsString(bug)); } }
void HandleBugsListSelectionChanged(object sender, EventArgs e) { foreach (Widget w in commentsBox.Children) { commentsBox.Remove(w); w.Destroy(); } var sel = GetSelection(); if (sel.Count == 0) { bugTitle.Text = string.Empty; return; } BugInfo bi = sel [0]; bugTitle.Markup = "<b>" + bi.Id + " - " + GLib.Markup.EscapeText(bi.Summary) + "</b>"; foreach (CommentInfo ci in bi.Comments) { Label header = new Label(); header.Xalign = 0; header.Selectable = true; string priv = ci.IsPrivate ? " (Private)" : ""; header.Markup = "<b>" + ci.Time.ToShortDateString() + " " + GLib.Markup.EscapeText(ci.Author) + priv + "</b>"; commentsBox.PackStart(header, false, false, 0); TextView text = new TextView(); text.Buffer.Text = ci.Text; text.Editable = false; text.WrapMode = WrapMode.WordChar; commentsBox.PackStart(text, false, false, 0); } commentsBox.ShowAll(); buttonRefresh.Visible = bi.RequiresRefresh; }
string GetTagsString(BugInfo b) { return(string.Join(",", b.Tags)); }
bool IsFiltered(BugInfo bi) { if (bi.Status == "NEEDINFO" || bi.Status == "CLOSED" || bi.Status == "RESOLVED" || bi.Status == "VERIFIED") return true; string filter = entryFilter.Text.ToLower (); if (filter.Length > 0) { if (bi.Summary.ToLower ().IndexOf (filter) == -1) { if (bi.Comments.All (ci => ci.Text.ToLower ().IndexOf (filter) == -1)) return true; } } return false; }
string GrepGroupValue(BugInfo b) { switch (lastGroupCommand) { case GroupCommand.GroupByComponent: return b.Component; case GroupCommand.GroupByMilestone: return b.TargetMilestone; case GroupCommand.GroupByOwner: return b.Assignee; case GroupCommand.GroupBySeverity: return b.Severity; case GroupCommand.GroupByStatus: return b.Status; case GroupCommand.GroupByTag: return GetTagsString (b); } return ""; }
string GetTagsString(BugInfo b) { return string.Join (",", b.Tags); }
void AppendBug(TreeIter pi, BugInfo bug) { int age = (int) (DateTime.Now - bug.DateCreated).TotalDays; int we = bug.IsNew ? 700 : 400; object bg; if (bug.LocalPriority <= server.HighPriorityLevel) bg = HighPrioColor; else if (bug.LocalPriority <= server.MedPriorityLevel) bg = MedPrioColor; else if (bug.LocalPriority <= server.LowPriorityLevel) bg = LowPrioColor; else bg = null; object fg; if (bug.Tags != null && bug.Tags.Length > 0) fg = server.GetTagColor (bug.Tags[0]); else fg = null; if (pi.Equals (TreeIter.Zero)) bugsStore.AppendValues (bug, GrepGroupValue (bug), bug.Id, bug.LocalPriority, bug.Status, bug.Severity, bug.TargetMilestone, age, bug.Assignee, bug.OperatingSystem, bug.Component, bug.Summary, we, bg, fg, GetTagsString (bug)); else bugsStore.AppendValues (pi, bug, GrepGroupValue (bug), bug.Id, bug.LocalPriority, bug.Status, bug.Severity, bug.TargetMilestone, age, bug.Assignee, bug.OperatingSystem, bug.Component, bug.Summary, we, bg, fg, GetTagsString (bug)); }