/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/treeview.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-14 20:12:19 UTC
  • Revision ID: jelmer@samba.org-20110314201219-wo692nzwywu6mevh
Fix formatting, imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
import gtk
10
10
import gobject
11
11
import pango
12
 
import treemodel
 
12
 
13
13
from bzrlib import ui
14
 
 
15
 
from bzrlib.plugins.gtk.ui import ProgressPanel
16
 
from linegraph import linegraph, same_branch
17
 
from graphcell import CellRendererGraph
18
 
from treemodel import TreeModel
19
14
from bzrlib.revision import NULL_REVISION
 
15
 
20
16
from bzrlib.plugins.gtk import lock
 
17
from bzrlib.plugins.gtk.ui import ProgressPanel
 
18
from bzrlib.plugins.gtk.branchview import treemodel
 
19
from bzrlib.plugins.gtk.branchview.linegraph import linegraph, same_branch
 
20
from bzrlib.plugins.gtk.branchview.graphcell import CellRendererGraph
21
21
 
22
22
 
23
23
class TreeView(gtk.VBox):
232
232
            lock.acquire(self.branch, lock.READ)
233
233
 
234
234
            self.emit('tag-added', tag, revid)
235
 
        
 
235
 
236
236
    def refresh(self):
237
237
        gobject.idle_add(self.populate, self.get_revision())
238
238
 
298
298
                broken_line_length = 32
299
299
            else:
300
300
                broken_line_length = None
301
 
            
 
301
 
302
302
            show_graph = self.graph_column.get_visible()
303
303
 
304
304
            self.branch.lock_read()
310
310
                                                            self.mainline_only,
311
311
                                                            self.progress_bar)
312
312
 
313
 
            self.model = TreeModel(self.branch, linegraphdata)
 
313
            self.model = treemodel.TreeModel(self.branch, linegraphdata)
314
314
            self.graph_cell.columns_len = columns_len
315
315
            width = self.graph_cell.get_size(self.treeview)[2]
316
316
            if width > 500:
335
335
 
336
336
        self.treeview.set_rules_hint(True)
337
337
        self.treeview.set_search_column(treemodel.REVNO)
338
 
        
 
338
 
339
339
        # Fix old PyGTK bug - by JAM
340
340
        set_tooltip = getattr(self.treeview, 'set_tooltip_column', None)
341
341
        if set_tooltip is not None:
411
411
        self.date_column.pack_start(cell, expand=True)
412
412
        self.date_column.add_attribute(cell, "text", treemodel.TIMESTAMP)
413
413
        self.treeview.append_column(self.date_column)
414
 
        
 
414
 
415
415
        return self.treeview
416
 
    
 
416
 
417
417
    def _on_selection_changed(self, treeview):
418
418
        """callback for when the treeview changes."""
419
419
        (path, focus) = treeview.get_cursor()