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

  • Committer: Scott James Remnant
  • Date: 2005-10-17 07:55:01 UTC
  • Revision ID: scott@netsplit.com-20051017075501-da054d3ea25e21c5
Add an extra window type, clicking the little icons next to a parent
revision will open a window with the differences between the revision
and that one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    for a particular branch.
30
30
    """
31
31
 
32
 
    def __init__(self):
 
32
    def __init__(self, app=None):
33
33
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
34
34
        self.set_border_width(0)
35
35
        self.set_title("bzrk")
36
36
 
 
37
        self.app = app
 
38
 
37
39
        # Use three-quarters of the screen by default
38
40
        screen = self.get_screen()
39
41
        monitor = screen.get_monitor_geometry(0)
227
229
        the new branch before updating the window title and model of the
228
230
        treeview itself.
229
231
        """
 
232
        self.branch = branch
 
233
 
230
234
        # [ revision, node, last_lines, lines, message, committer, timestamp ]
231
235
        self.model = gtk.ListStore(gobject.TYPE_PYOBJECT,
232
236
                                   gobject.TYPE_PYOBJECT,
319
323
            button = gtk.Button()
320
324
            button.add(image)
321
325
            button.set_relief(gtk.RELIEF_NONE)
322
 
            button.set_sensitive(False)
323
 
            button.connect("clicked", self._show_clicked_cb, parent_id)
 
326
            button.set_sensitive(self.app is not None)
 
327
            button.connect("clicked", self._show_clicked_cb,
 
328
                           revision.revision_id, parent_id)
324
329
            hbox.pack_start(button, expand=False, fill=True)
325
330
            button.show()
326
331
 
359
364
        """Callback for when the go button for a parent is clicked."""
360
365
        self.treeview.set_cursor(self.index[self.revisions[revid]])
361
366
 
362
 
    def _show_clicked_cb(self, widget, revid):
 
367
    def _show_clicked_cb(self, widget, revid, parentid):
363
368
        """Callback for when the show button for a parent is clicked."""
364
 
        print "SHOW %s" % revid
 
369
        if self.app is not None:
 
370
            self.app.show_diff(self.branch, revid, parentid)