/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

Merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
from bzrlib.plugins.gtk.window import Window
17
17
from bzrlib.plugins.gtk.tags import AddTagDialog
18
18
from bzrlib.plugins.gtk.preferences import PreferencesWindow
 
19
from bzrlib.plugins.gtk.branchview import TreeView
19
20
from bzrlib.revision import Revision
20
21
from bzrlib.config import BranchConfig
21
22
from bzrlib.config import GlobalConfig
22
 
from treeview import TreeView
23
23
 
24
24
class BranchWindow(Window):
25
25
    """Branch window.
291
291
    def construct_bottom(self):
292
292
        """Construct the bottom half of the window."""
293
293
        from bzrlib.plugins.gtk.revisionview import RevisionView
294
 
        self.revisionview = RevisionView(None, tags=[], show_children=True, branch=self.branch)
 
294
        self.revisionview = RevisionView(branch=self.branch)
295
295
        (width, height) = self.get_size()
296
296
        self.revisionview.set_size_request(width, int(height / 2.5))
297
297
        self.revisionview.show()
298
298
        self.revisionview.set_show_callback(self._show_clicked_cb)
299
 
        self.revisionview.set_go_callback(self._go_clicked_cb)
 
299
        self.revisionview.connect('notify::revision', self._go_clicked_cb)
300
300
        return self.revisionview
301
301
 
302
302
    def _tag_selected_cb(self, menuitem, revid):
349
349
 
350
350
            self.next_button.set_menu(next_menu)
351
351
 
352
 
            tags = []
353
 
            if self.branch.supports_tags():
354
 
                tagdict = self.branch.tags.get_reverse_tag_dict()
355
 
                if tagdict.has_key(revision.revision_id):
356
 
                    tags = tagdict[revision.revision_id]
357
 
            self.revisionview.set_revision(revision, tags, children)
 
352
            self.revisionview.set_revision(revision)
 
353
            self.revisionview.set_children(children)
358
354
 
359
355
    def _back_clicked_cb(self, *args):
360
356
        """Callback for when the back button is clicked."""
364
360
        """Callback for when the forward button is clicked."""
365
361
        self.treeview.forward()
366
362
 
367
 
    def _go_clicked_cb(self, revid):
 
363
    def _go_clicked_cb(self, w, p):
368
364
        """Callback for when the go button for a parent is clicked."""
369
 
        self.treeview.set_revision_id(revid)
 
365
        if self.revisionview.get_revision() is not None:
 
366
            self.treeview.set_revision(self.revisionview.get_revision())
370
367
 
371
368
    def _show_clicked_cb(self, revid, parentid):
372
369
        """Callback for when the show button for a parent is clicked."""