Merge lp:~emanuele-aina/gtimelog/fix-status-icon-position-menu-pygi into lp:~gtimelog-dev/gtimelog/trunk

Proposed by Emanuele Aina
Status: Merged
Merged at revision: 232
Proposed branch: lp:~emanuele-aina/gtimelog/fix-status-icon-position-menu-pygi
Merge into: lp:~gtimelog-dev/gtimelog/trunk
Diff against target: 21 lines (+8/-3)
1 file modified
src/gtimelog/main.py (+8/-3)
To merge this branch: bzr merge lp:~emanuele-aina/gtimelog/fix-status-icon-position-menu-pygi
Reviewer Review Type Date Requested Status
Marius Gedminas Approve
Review via email: mp+120752@code.launchpad.net

Description of the change

This branch fixes LP#1039977 by replacing the usage of status_icon_position_menu with gtk.StatusIcon.position_menu when using PyGI (and swapping some of the tray_icon_popup_menu.popup() arguments).

To post a comment you must log in.
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Thank you!

http://fpaste.org/osUI/ is more what I had in mind (keep the 'if toolkit' checks in one place, at the top), but didn't commit because it didn't work. Now I realize that the differing argument ordering makes my kind of fix impossible. I either have to litter the code with if statements, or bite the bullet and rip out the obsolete pygtk support code.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I committed your patch as is, because life is short. Thanks a lot!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gtimelog/main.py'
2--- src/gtimelog/main.py 2012-08-22 12:01:41 +0000
3+++ src/gtimelog/main.py 2012-08-22 12:04:29 +0000
4@@ -1181,9 +1181,14 @@
5 def on_popup_menu(self, widget, button, activate_time):
6 """The user clicked on the icon."""
7 tray_icon_popup_menu = self.gtimelog_window.tray_icon_popup_menu
8- tray_icon_popup_menu.popup(
9- None, None, gtk.status_icon_position_menu,
10- button, activate_time, self.icon)
11+ if toolkit == "gi":
12+ tray_icon_popup_menu.popup(
13+ None, None, gtk.StatusIcon.position_menu,
14+ self.icon, button, activate_time)
15+ else:
16+ tray_icon_popup_menu.popup(
17+ None, None, gtk.status_icon_position_menu,
18+ button, activate_time, self.icon)
19
20 def entry_added(self, entry):
21 """An entry has been added."""

Subscribers

People subscribed via source and target branches