Merge lp:~pitti/gtimelog/pygi into lp:~gtimelog-dev/gtimelog/trunk

Proposed by Martin Pitt
Status: Merged
Approved by: Barry Warsaw
Approved revision: 198
Merged at revision: 196
Proposed branch: lp:~pitti/gtimelog/pygi
Merge into: lp:~gtimelog-dev/gtimelog/trunk
Diff against target: 37 lines (+11/-1)
2 files modified
NEWS.txt (+5/-0)
src/gtimelog/main.py (+6/-1)
To merge this branch: bzr merge lp:~pitti/gtimelog/pygi
Reviewer Review Type Date Requested Status
Barry Warsaw Approve
Review via email: mp+76169@code.launchpad.net

Description of the change

Seems 0.6 accidentally dropped the required import of "gi" when using GI. Also, it seems my TabAlign.LEFT -> TabAlign.TAB_LEFT change was wrong, this is due to a broken .gir of Pango in the Ubuntu packages. With upstream Pango it really is TabAlign.LEFT, as it is supposed to be with GIR. However, I added a backwards compat quirk to work with either.

With this, gtimelog again works fine in jhbuild with current GTK3/Pango/etc.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Thanks Martin, this looks great. I'll commit this to trunk, but I want to hold off on uploading it to Ubuntu until I can fix the quit-button issue (i.e. ctrl-Q works but the quit button only closes the window).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS.txt'
2--- NEWS.txt 2011-08-23 22:21:14 +0000
3+++ NEWS.txt 2011-09-20 08:38:24 +0000
4@@ -1,3 +1,8 @@
5+Changes in version 0.6.1 (UNRELEASED)
6+==============================================
7+
8+* Fix two crashes when using GI.
9+
10 Changes in version 0.6.0 (released 2011-08-23)
11 ==============================================
12
13
14=== modified file 'src/gtimelog/main.py'
15--- src/gtimelog/main.py 2011-08-17 18:18:23 +0000
16+++ src/gtimelog/main.py 2011-09-20 08:38:24 +0000
17@@ -41,6 +41,7 @@
18 new_app_indicator = None
19
20 except ImportError:
21+ import gi
22 from gi.repository import GObject as gobject
23 from gi.repository import Gdk as gdk
24 from gi.repository import Gtk as gtk
25@@ -48,7 +49,11 @@
26 pygtk = None
27
28 # these are hacks until we fully switch to GI
29- PANGO_ALIGN_LEFT = pango.TabAlign.TAB_LEFT
30+ try:
31+ PANGO_ALIGN_LEFT = pango.TabAlign.LEFT
32+ except AttributeError:
33+ # backwards compat for older Pango versions with broken GIR
34+ PANGO_ALIGN_LEFT = pango.TabAlign.TAB_LEFT
35 GTK_RESPONSE_OK = gtk.ResponseType.OK
36 gtk_status_icon_new = gtk.StatusIcon.new_from_file
37 pango_tabarray_new = pango.TabArray.new

Subscribers

People subscribed via source and target branches