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

  • Committer: Jelmer Vernooij
  • Date: 2007-07-15 15:13:34 UTC
  • Revision ID: jelmer@samba.org-20070715151334-2t0g8fmpgj6vnqa7
Add icon for Bazaar preferences.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    for a particular branch.
27
27
    """
28
28
 
29
 
    def __init__(self, app=None):
 
29
    def __init__(self):
30
30
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
31
31
        self.set_border_width(0)
32
32
        self.set_title("bzrk")
33
33
 
34
 
        self.app = app
35
 
 
36
34
        # Use three-quarters of the screen by default
37
35
        screen = self.get_screen()
38
36
        monitor = screen.get_monitor_geometry(0)
149
147
        """Construct the bottom half of the window."""
150
148
        from bzrlib.plugins.gtk.logview import LogView
151
149
        self.logview = LogView()
152
 
        self.logview.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
153
 
        self.logview.set_shadow_type(gtk.SHADOW_NONE)
154
150
        (width, height) = self.get_size()
155
151
        self.logview.set_size_request(width, int(height / 2.5))
156
152
        self.logview.show()
246
242
        self.treeview.set_cursor(self.index[self.revisions[revid]])
247
243
        self.treeview.grab_focus()
248
244
 
 
245
    def show_diff(self, branch, revid, parentid):
 
246
        """Open a new window to show a diff between the given revisions."""
 
247
        from bzrlib.plugins.gtk.diff import DiffWindow
 
248
        window = DiffWindow()
 
249
        rev_tree = branch.repository.revision_tree(revid)
 
250
        parent_tree = branch.repository.revision_tree(parentid)
 
251
        description = revid + " - " + branch.nick
 
252
        window.set_diff(description, rev_tree, parent_tree)
 
253
        window.show()
 
254
 
249
255
    def _show_clicked_cb(self, revid, parentid):
250
256
        """Callback for when the show button for a parent is clicked."""
251
 
        if self.app is not None:
252
 
            self.app.show_diff(self.branch, revid, parentid)
 
257
        self.show_diff(self.branch, revid, parentid)
253
258
        self.treeview.grab_focus()
254
259
 
255
260
    def _treeview_row_activated_cb(self, widget, path, col):
260
265
            # Ignore revisions without parent
261
266
            return
262
267
        parent_id = self.parent_ids[revision][0]
263
 
        if self.app is not None:
264
 
            self.app.show_diff(self.branch, revision.revision_id, parent_id)
 
268
        self.show_diff(self.branch, revision.revision_id, parent_id)
265
269
        self.treeview.grab_focus()