/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: Vincent Ladeuil
  • Date: 2009-12-09 13:27:53 UTC
  • mto: (671.1.2 gtk)
  • mto: This revision was merged to the branch mainline in revision 709.
  • Revision ID: v.ladeuil+lp@free.fr-20091209132753-q00e90p46rwi4isg
Ensure compatibility with PyGtk-2.8.

* viz/branchwin.py:
(BranchWindow.__init__): Use a getattr() call to protect
PyGtk-2.10 specific feature access.

* revisionview.py: 
Use a getattr() call to protect PyGtk-2.10 specific feature access.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: UTF-8 -*-
2
1
"""Branch window.
3
2
 
4
3
This module contains the code to manage the branch information window,
5
4
which contains both the revision graph and details panes.
6
5
"""
7
6
 
8
 
__copyright__ = "Copyright © 2005 Canonical Ltd."
 
7
__copyright__ = "Copyright (c) 2005 Canonical Ltd."
9
8
__author__    = "Scott James Remnant <scott@ubuntu.com>"
10
9
 
11
10
 
80
79
        self.accel_group = gtk.AccelGroup()
81
80
        self.add_accel_group(self.accel_group)
82
81
 
83
 
#        gtk.Action.set_tool_item_type(gtk.MenuToolButton)
 
82
        if getattr(gtk.Action, 'set_tool_item_type', None) is not None:
 
83
            # Not available before PyGtk-2.10
 
84
            gtk.Action.set_tool_item_type(gtk.MenuToolButton)
84
85
 
85
86
        self.prev_rev_action = gtk.Action("prev-rev", "_Previous Revision", "Go to the previous revision", gtk.STOCK_GO_DOWN)
86
87
        self.prev_rev_action.set_accel_path("<viz>/Go/Previous Revision")