Beispiel #1
0
        /// <summary>
        /// TODO: write a comment.
        /// </summary>
        /// <param name="target"> A BugReport </param>
        private void DrawCommentsFromReport(BugReport target)
        {
            // Clear the comment VBox
            foreach(Widget w in commentVBox.Children)
            {
                commentVBox.Remove(w);
                w.Dispose();
            }

            foreach(var com in target.Comments)
            {
                CommentSingletonWidget commentWidget = new CommentSingletonWidget();
                commentWidget.SetComment(com);
                commentWidget.ShowAll();

                commentVBox.PackStart(commentWidget, false, false, 0);
            }
        }
Beispiel #2
0
        void BugTreeRowActivated(object o, RowActivatedArgs args)
        {
            Console.WriteLine ("Row activated + " + args.Path.Indices.Length);
            commentSendButton.Sensitive = false;

            // Check the length of the indices array in the path. We are ideally looking for something which is
            // in the first level of nesting.
            if(args.Path.Indices.Length != 1)
            {
                commentSendButton.Sensitive = true;

                BugReport target = BugReportFromTreePath (args.Path);
                lock(activeBug)
                {
                activeBug = target;
                activeQuery = SplatterCore.Instance.Queries[args.Path.Indices[0]];

                DrawCommentsFromReport (target);

                }

                // Set the bug details
                int row_id = 0;
                /*
                 *
                 * TODO: Change the number of rows as you add more properties to the table
                 *
                 */
                bugPropertyTable.Resize(10, 2);

                foreach (Widget child in bugPropertyTable.Children) {
                    bugPropertyTable.Remove(child);
                }

                StringValueToTable(bugPropertyTable, "Bug ID", target.id.ToString(), ref row_id);
                StringValueToTable(bugPropertyTable, "Component", target.component, ref row_id);
                StringValueToTable(bugPropertyTable, "Product", target.product, ref row_id);
                StringValueToTable(bugPropertyTable, "Assigned To", target.assigned_to, ref row_id);
                StringValueToTable(bugPropertyTable, "Resolution", target.resolution, ref row_id);
                StringValueToTable(bugPropertyTable, "Status", target.status, ref row_id);
                StringValueToTable(bugPropertyTable, "Severity", target.severity, ref row_id);
                StringValueToTable(bugPropertyTable, "Priority", target.priority, ref row_id);
                StringValueToTable(bugPropertyTable, "Created", target.creation_time.ToString(), ref row_id);
                StringValueToTable(bugPropertyTable, "Last Changed", target.last_change_time.ToString(), ref row_id);

                // Mark bug as having no unread comments
                target.BugChangedFlag = false;
                target.NewCommentFlag = false;

                // Force UI Refresh
                this.SyncTreeviewWithBugs();
            }
        }