/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to branchview/linegraph.py

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 18:12:29 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629181229-1l2m4cf7vvbyh8qg
Simplify progress bar code, use embedded progress bar inside viz window.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    def update_root_progress(step_number):
48
48
        """IFF our container received a root progress bar, then update it."""
49
49
        if root_progress is not None:
50
 
            root_progress.update(current=step_number)
 
50
            root_progress.update(current_cnt=step_number)
51
51
 
52
52
    graph_parents = {}
53
53
    ghosts = set()
75
75
    update_root_progress(2)
76
76
    progress_bar = ui.ui_factory.nested_progress_bar()
77
77
    try:
78
 
        progress_bar.update(msg="Removing ghosts", total=len(ghosts))
 
78
        progress_bar.update(msg="Removing ghosts", total_cnt=len(ghosts))
79
79
        for i, ghost in enumerate(ghosts):
80
80
            if i % 25 == 0:
81
 
                progress_bar.update(current=i)
 
81
                progress_bar.update(None, current_cnt=i)
82
82
            for ghost_child in graph_children[ghost]:
83
83
                graph_parents[ghost_child] = [p for p in graph_parents[ghost_child]
84
84
                                              if p not in ghosts]
118
118
    update_root_progress(3)
119
119
    progress_bar = ui.ui_factory.nested_progress_bar()
120
120
    try:
121
 
        progress_bar.update(msg="Finding nodes", total=len(merge_sorted_revisions))
 
121
        progress_bar.update(msg="Finding nodes", total_cnt=len(merge_sorted_revisions))
122
122
        for (rev_index, (sequence_number,
123
123
                         revid,
124
124
                         merge_depth,
126
126
                         end_of_merge)) in enumerate(merge_sorted_revisions):
127
127
 
128
128
            if rev_index % 25 == 0:
129
 
                progress_bar.update(current=rev_index)
 
129
                progress_bar.update(None, current_cnt=rev_index)
130
130
            if maxnum and rev_index >= maxnum:
131
131
                break
132
132
            revid_index[revid] = rev_index
184
184
        update_root_progress(4)
185
185
        progress_bar = ui.ui_factory.nested_progress_bar()
186
186
        try:
187
 
            progress_bar.update(msg="Organizing edges", total=len(branch_ids))
 
187
            progress_bar.update(msg="Organizing edges", total_cnt=len(branch_ids))
188
188
            for i, branch_id in enumerate(branch_ids):
189
189
                if i % 25 == 0:
190
 
                    progress_bar.update(current=i)
 
190
                    progress_bar.update(None, current_cnt=i)
191
191
                branch_line = branch_lines[branch_id]
192
192
                
193
193
                # Find the col_index for the direct parent branch. This will be the
314
314
        update_root_progress(5)
315
315
        progress_bar = ui.ui_factory.nested_progress_bar()
316
316
        try:
317
 
            progress_bar.update(msg="Pretifying graph", total=len(lines))
 
317
            progress_bar.update(msg="Pretifying graph", total_cnt=len(lines))
318
318
            for i, (child_index, parent_index, line_col_indexes) in enumerate(lines):
319
319
                if i % 25 == 0:
320
 
                    progress_bar.update(current=i)
 
320
                    progress_bar.update(None, current_cnt=i)
321
321
                (child_col_index, child_color) = linegraph[child_index][1]
322
322
                (parent_col_index, parent_color) = linegraph[parent_index][1]
323
323