/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: Curtis Hovey
  • Date: 2011-09-03 01:25:04 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110903012504-0jr4diz9033g5df2
Menu fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        :param broken_line_length: After how much lines to break 
106
106
                                   branches.
107
107
        """
108
 
        super(TreeView, self).__init__(homogeneous=False, spacing=0)
 
108
        Gtk.VBox.__init__(self, homogeneous=False, spacing=0)
109
109
 
110
110
        self.progress_widget = ProgressPanel()
111
111
        self.pack_start(self.progress_widget, False, True, 0)
131
131
        self.maxnum = maxnum
132
132
        self.compact = compact
133
133
 
134
 
        self.model = treemodel.BranchTreeModel(self.branch, [])
 
134
        self.model = treemodel.TreeModel(self.branch, [])
135
135
        GObject.idle_add(self.populate)
136
136
 
137
137
        self.connect("destroy", self._on_destroy)
312
312
            show_graph = self.graph_column.get_visible()
313
313
 
314
314
            self.branch.lock_read()
315
 
            (linegraphdata, index, columns_len) = linegraph(
316
 
                self.branch.repository.get_graph(),
317
 
                self.start,
318
 
                self.maxnum, 
319
 
                broken_line_length,
320
 
                show_graph,
321
 
                self.mainline_only,
322
 
                self.progress_bar)
 
315
            (linegraphdata, index, columns_len) = linegraph(self.branch.repository.get_graph(),
 
316
                                                            self.start,
 
317
                                                            self.maxnum, 
 
318
                                                            broken_line_length,
 
319
                                                            show_graph,
 
320
                                                            self.mainline_only,
 
321
                                                            self.progress_bar)
323
322
 
324
 
            self.model.set_line_graph_data(linegraphdata)
 
323
            self.model.line_graph_data = linegraphdata
325
324
            self.graph_cell.columns_len = columns_len
326
325
            width = self.graph_cell.get_preferred_width(self.treeview)[1]
327
326
            if width > 500:
362
361
        self.treeview.set_enable_search(True)
363
362
 
364
363
        self.treeview.set_tooltip_column(treemodel.MESSAGE)
365
 
        self.treeview.set_headers_visible(True)
366
364
 
367
365
        self._prev_cursor_path = None
368
366
        self.treeview.connect("cursor-changed",
395
393
        self.graph_column.set_resizable(True)
396
394
        self.graph_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
397
395
        self.graph_column.pack_start(self.graph_cell, True)
398
 
        self.graph_column.add_attribute(
399
 
            self.graph_cell, "node", treemodel.NODE)
400
 
        self.graph_column.add_attribute(
401
 
            self.graph_cell, "tags", treemodel.TAGS)
402
 
        self.graph_column.add_attribute(
403
 
            self.graph_cell, "in-lines", treemodel.LAST_LINES)
404
 
        self.graph_column.add_attribute(
405
 
            self.graph_cell, "out-lines", treemodel.LINES)
 
396
        self.graph_column.add_attribute(self.graph_cell, "node", treemodel.NODE)
 
397
        self.graph_column.add_attribute(self.graph_cell, "tags", treemodel.TAGS)
 
398
        self.graph_column.add_attribute(self.graph_cell, "in-lines", treemodel.LAST_LINES)
 
399
        self.graph_column.add_attribute(self.graph_cell, "out-lines", treemodel.LINES)
406
400
        self.treeview.append_column(self.graph_column)
407
401
 
408
402
        cell = Gtk.CellRendererText()
454
448
    def _on_revision_selected(self, widget, event):
455
449
        from bzrlib.plugins.gtk.revisionmenu import RevisionMenu
456
450
        if event.button == 3:
457
 
            revs = []
458
 
            rev = self.get_revision()
459
 
            if rev is not None:
460
 
                revs.append(rev.revision_id)
461
 
            menu = RevisionMenu(self.branch.repository, revs, self.branch)
 
451
            menu = RevisionMenu(self.branch.repository, 
 
452
                [self.get_revision().revision_id],
 
453
                self.branch)
462
454
            menu.connect('tag-added', lambda w, t, r: self.add_tag(t, r))
463
 
            menu.popup(None, None, None, None, event.button, event.get_time())
 
455
            menu.popup(None, None, None, event.button, event.get_time())
464
456
 
465
457
    def _on_revision_activated(self, widget, path, col):
466
458
        self.emit('revision-activated', path, col)