Merge lp:~smartgpx/bzr-gtk/workaround_for_lp494140_B into lp:bzr-gtk/gtk2

Proposed by David Roberts
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 673
Merged at revision: 709
Proposed branch: lp:~smartgpx/bzr-gtk/workaround_for_lp494140_B
Merge into: lp:bzr-gtk/gtk2
Diff against target: 69 lines (+12/-7)
2 files modified
revisionview.py (+4/-2)
viz/branchwin.py (+8/-5)
To merge this branch: bzr merge lp:~smartgpx/bzr-gtk/workaround_for_lp494140_B
Reviewer Review Type Date Requested Status
Martin Pool (community) Approve
Review via email: mp+23238@code.launchpad.net

Commit message

Fix support for PyGTK versions without gtk.link_button_set_uri_hook().

Description of the change

Raising a Merge Proposal because that's what discussion in Answers asks me to do. I think there is some concern (justified) about reduced functionality and performance impact.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

looks reasonable to me;

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'revisionview.py'
2--- revisionview.py 2009-06-10 18:07:35 +0000
3+++ revisionview.py 2010-04-12 15:20:33 +0000
4@@ -51,13 +51,15 @@
5 webbrowser._tryorder.insert(0, '%s "%%s"' % cmd)
6 webbrowser.open(uri)
7
8-gtk.link_button_set_uri_hook(_open_link)
9+if getattr(gtk, 'link_button_set_uri_hook', None) is not None:
10+ # Not available before PyGtk-2.10
11+ gtk.link_button_set_uri_hook(_open_link)
12
13 class BugsTab(gtk.VBox):
14
15 def __init__(self):
16 super(BugsTab, self).__init__(False, 6)
17-
18+
19 table = gtk.Table(rows=2, columns=2)
20
21 table.set_row_spacings(6)
22
23=== modified file 'viz/branchwin.py'
24--- viz/branchwin.py 2009-05-25 15:57:23 +0000
25+++ viz/branchwin.py 2010-04-12 15:20:33 +0000
26@@ -1,11 +1,10 @@
27-# -*- coding: UTF-8 -*-
28 """Branch window.
29
30 This module contains the code to manage the branch information window,
31 which contains both the revision graph and details panes.
32 """
33
34-__copyright__ = "Copyright © 2005 Canonical Ltd."
35+__copyright__ = "Copyright (c) 2005 Canonical Ltd."
36 __author__ = "Scott James Remnant <scott@ubuntu.com>"
37
38
39@@ -80,7 +79,9 @@
40 self.accel_group = gtk.AccelGroup()
41 self.add_accel_group(self.accel_group)
42
43- gtk.Action.set_tool_item_type(gtk.MenuToolButton)
44+ if getattr(gtk.Action, 'set_tool_item_type', None) is not None:
45+ # Not available before PyGtk-2.10
46+ gtk.Action.set_tool_item_type(gtk.MenuToolButton)
47
48 self.prev_rev_action = gtk.Action("prev-rev", "_Previous Revision", "Go to the previous revision", gtk.STOCK_GO_DOWN)
49 self.prev_rev_action.set_accel_path("<viz>/Go/Previous Revision")
50@@ -413,7 +414,8 @@
51 self.prev_rev_action.set_sensitive(False)
52 prev_menu.hide()
53
54- self.prev_button.set_menu(prev_menu)
55+ if getattr(self.prev_button, 'set_menu', None) is not None:
56+ self.prev_button.set_menu(prev_menu)
57
58 next_menu = gtk.Menu()
59 if len(children) > 0:
60@@ -433,7 +435,8 @@
61 self.next_rev_action.set_sensitive(False)
62 next_menu.hide()
63
64- self.next_button.set_menu(next_menu)
65+ if getattr(self.next_button, 'set_menu', None) is not None:
66+ self.next_button.set_menu(next_menu)
67
68 self.revisionview.set_revision(revision)
69 self.revisionview.set_children(children)

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: