Merge lp:~alphapapa/pithos/888778 into lp:~kevin-mehall/pithos/trunk

Proposed by Adam Porter
Status: Superseded
Proposed branch: lp:~alphapapa/pithos/888778
Merge into: lp:~kevin-mehall/pithos/trunk
Diff against target: 36 lines (+11/-4)
2 files modified
bin/pithos (+6/-3)
pithos/dbus_service.py (+5/-1)
To merge this branch: bzr merge lp:~alphapapa/pithos/888778
Reviewer Review Type Date Requested Status
Kevin Mehall Pending
Review via email: mp+86219@code.launchpad.net

This proposal has been superseded by a proposal from 2011-12-19.

Description of the change

Fixed lp:888778.

To post a comment you must log in.
lp:~alphapapa/pithos/888778 updated
183. By Adam Porter

Fixed so the bring_to_top() toggle will iconify if the notification icon is off, but hide if it's on.

184. By Adam Porter

Changed bring_to_top() to toggle_window() and added ToggleWindow DBUS method. Left Present method for backwards-compatibility with existing users. :)

185. By Adam Porter

Updated notification_icon plugin to use new main toggle_window() function.
Added separators in indicator icon menus; looks much better.
Fixed incorrect labels in indicator icon menus (on KDE, at least, they were using Gtk stock labels, e.g. "Jump to" instead of "Tired").
Turned off icons in indicator menu due to #627218. At least it's consistent this way. Also, the trend is moving away from icons in menus toward a cleaner look--Unity doesn't even allow them.

186. By Adam Porter

Removed dead line of code.

187. By Adam Porter

One more.

188. By Adam Porter

The libindicator icon doesn't work that well, at least on KDE. 1) It doesn't support the left-click event on KDE, 2) it doesn't show the right icons on KDE. And these bugs depend on libappindicator being updated--we're at their mercy. So I made a "status_icon" plugin that's just a copy of the notification_icon plugin without the libindicator code, so it only uses a Gtk status icon. And that shows the right icons on KDE and supports the left-click event, so a simple left click shows and hides the window. The preferences allow either or both to be enabled, so users can try both. I suppose a group enabled by a checkbox containing radio buttons might be more correct, but this is simple and works.

189. By Adam Porter

Fixed mediakeys.py to work with toggle_window().

190. By Adam Porter

Added exception handling.

191. By Adam Porter

Added comment, because keybinder.bind() doesn't raise an exception if it fails.

192. By Adam Porter

Added errors for failed keybindings.

Unmerged revisions

192. By Adam Porter

Added errors for failed keybindings.

191. By Adam Porter

Added comment, because keybinder.bind() doesn't raise an exception if it fails.

190. By Adam Porter

Added exception handling.

189. By Adam Porter

Fixed mediakeys.py to work with toggle_window().

188. By Adam Porter

The libindicator icon doesn't work that well, at least on KDE. 1) It doesn't support the left-click event on KDE, 2) it doesn't show the right icons on KDE. And these bugs depend on libappindicator being updated--we're at their mercy. So I made a "status_icon" plugin that's just a copy of the notification_icon plugin without the libindicator code, so it only uses a Gtk status icon. And that shows the right icons on KDE and supports the left-click event, so a simple left click shows and hides the window. The preferences allow either or both to be enabled, so users can try both. I suppose a group enabled by a checkbox containing radio buttons might be more correct, but this is simple and works.

187. By Adam Porter

One more.

186. By Adam Porter

Removed dead line of code.

185. By Adam Porter

Updated notification_icon plugin to use new main toggle_window() function.
Added separators in indicator icon menus; looks much better.
Fixed incorrect labels in indicator icon menus (on KDE, at least, they were using Gtk stock labels, e.g. "Jump to" instead of "Tired").
Turned off icons in indicator menu due to #627218. At least it's consistent this way. Also, the trend is moving away from icons in menus toward a cleaner look--Unity doesn't even allow them.

184. By Adam Porter

Changed bring_to_top() to toggle_window() and added ToggleWindow DBUS method. Left Present method for backwards-compatibility with existing users. :)

183. By Adam Porter

Fixed so the bring_to_top() toggle will iconify if the notification icon is off, but hide if it's on.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pithos'
2--- bin/pithos 2011-12-15 00:15:02 +0000
3+++ bin/pithos 2011-12-19 11:29:23 +0000
4@@ -745,9 +745,12 @@
5 self.stations_dlg = StationsDialog.NewStationsDialog(self)
6 self.stations_dlg.show_all()
7
8- def bring_to_top(self, *ignore):
9- self.show()
10- self.present()
11+ def toggle_window(self, *ignore):
12+ if self.is_active():
13+ # If the notification icon is on, close the window; otherwise, iconify it
14+ if self.preferences.get(self.plugins['notification_icon'].preference, False): self.hide()
15+ else: self.iconify()
16+ else: self.present()
17
18
19 def quit(self, widget=None, data=None):
20
21=== modified file 'pithos/dbus_service.py'
22--- pithos/dbus_service.py 2010-08-25 23:50:34 +0000
23+++ pithos/dbus_service.py 2011-12-19 11:29:23 +0000
24@@ -63,7 +63,11 @@
25
26 @dbus.service.method(DBUS_BUS)
27 def Present(self):
28- self.window.bring_to_top()
29+ self.window.toggle_window()
30+
31+ @dbus.service.method(DBUS_BUS)
32+ def ToggleWindow(self):
33+ self.window.toggle_window()
34
35 @dbus.service.method(DBUS_BUS, out_signature='a{sv}')
36 def GetCurrentSong(self):