예제 #1
0
        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;
                    }
                }
            }
        }
예제 #2
0
        public void OpenBug(BugInfo b)
        {
            string url = useSSL ? "https" : "http";

            url += "://" + host + "/show_bug.cgi?id=" + b.Id;
            DesktopService.ShowUrl(url);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
        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("");
        }
예제 #6
0
        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);
        }
예제 #7
0
        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));
            }
        }
예제 #8
0
        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;
        }
예제 #9
0
 string GetTagsString(BugInfo b)
 {
     return(string.Join(",", b.Tags));
 }
예제 #10
0
 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;
 }
예제 #11
0
 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 "";
 }
예제 #12
0
 string GetTagsString(BugInfo b)
 {
     return string.Join (",", b.Tags);
 }
예제 #13
0
 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));
 }