/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 annotate/gannotate.py

  • Committer: Martin Albisetti
  • Date: 2008-03-04 22:13:43 UTC
  • mto: This revision was merged to the branch mainline in revision 439.
  • Revision ID: argentina@gmail.com-20080304221343-ixbdn2uf87z3jnfl
Added custom colored context icons

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
class GAnnotateWindow(Window):
46
46
    """Annotate window."""
47
47
 
48
 
    def __init__(self, all=False, plain=False, parent=None, branch=None):
 
48
    def __init__(self, all=False, plain=False, parent=None):
49
49
        self.all = all
50
50
        self.plain = plain
51
 
        self._branch = branch
52
51
        
53
52
        Window.__init__(self, parent)
54
53
        
114
113
 
115
114
        self.annoview.set_model(self.annomodel)
116
115
        self.annoview.grab_focus()
117
 
        my_revno = self.dotted.get(self.revision_id, 'current')
118
 
        title = '%s (%s) - gannotate' % (self.tree.id2path(file_id), my_revno)
119
 
        self.set_title(title)
120
116
 
121
117
    def jump_to_line(self, lineno):
122
118
        if lineno > len(self.annomodel) or lineno < 1:
178
174
 
179
175
    def _activate_selected_revision(self, w):
180
176
        rev_id = self._selected_revision()
181
 
        if not rev_id or rev_id == NULL_REVISION:
 
177
        if rev_id is None:
182
178
            return
183
179
        selected = self.revisions[rev_id]
184
180
        self.revisionview.set_revision(selected)
242
238
        self._search.show_for('line')
243
239
        self._search.set_target(self.annoview, LINE_NUM_COL)
244
240
 
245
 
    def line_diff(self, tv, path, tvc):
 
241
    def row_diff(self, tv, path, tvc):
246
242
        row = path[0]
247
243
        revision = self.annotations[row]
248
244
        repository = self.branch.repository
257
253
                tree2 = repository.revision_tree(NULL_REVISION)
258
254
        from bzrlib.plugins.gtk.diff import DiffWindow
259
255
        window = DiffWindow()
260
 
        window.set_diff("Diff for line %d" % (row+1), tree1, tree2)
 
256
        window.set_diff("Diff for row %d" % (row+1), tree1, tree2)
261
257
        window.set_file(tree1.id2path(self.file_id))
262
258
        window.show()
263
259
 
267
263
        tv.set_rules_hint(False)
268
264
        tv.connect("cursor-changed", self._activate_selected_revision)
269
265
        tv.show()
270
 
        tv.connect("row-activated", self.line_diff)
 
266
        tv.connect("row-activated", self.row_diff)
271
267
 
272
268
        cell = gtk.CellRendererText()
273
269
        cell.set_property("xalign", 1.0)
321
317
        return tv
322
318
 
323
319
    def _create_log_view(self):
324
 
        lv = RevisionView(self._branch)
 
320
        lv = RevisionView()
325
321
        lv.show()
326
322
        return lv
327
323