Update banshee current track when necessary. Defective by design but working. Fixes #2229
This commit is contained in:
parent
bd7bac578f
commit
24f8305b81
|
@ -220,6 +220,23 @@ class MusicTrackListener(gobject.GObject):
|
|||
self._last_playing_music = info
|
||||
return info
|
||||
|
||||
## Check Banshee playing track
|
||||
test = False
|
||||
if hasattr(bus, 'name_has_owner'):
|
||||
if bus.name_has_owner('org.bansheeproject.Banshee'):
|
||||
test = True
|
||||
elif dbus.dbus_bindings.bus_name_has_owner(bus.get_connection(),
|
||||
'org.bansheeproject.Banshee'):
|
||||
test = True
|
||||
if test:
|
||||
banshee = bus.get_object('org.bansheeproject.Banshee',
|
||||
'/org/bansheeproject/Banshee/PlayerEngine')
|
||||
currentTrack = banshee.GetCurrentTrack()
|
||||
if currentTrack:
|
||||
song = self._banshee_properties_extract(currentTrack)
|
||||
self._last_playing_music = song
|
||||
return song
|
||||
|
||||
return None
|
||||
|
||||
# here we test :)
|
||||
|
|
|
@ -1004,7 +1004,7 @@ class RosterWindow:
|
|||
gajim.connections[account].activity['activity'].strip(),
|
||||
gajim.connections[account].activity['subactivity'].strip()). \
|
||||
get_pixbuf()
|
||||
else:
|
||||
else:
|
||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = \
|
||||
gtkgui_helpers.load_activity_icon(
|
||||
gajim.connections[account].activity['activity'].strip()). \
|
||||
|
@ -3285,12 +3285,12 @@ class RosterWindow:
|
|||
act = widget.get_active()
|
||||
gajim.config.set_per('accounts', account, 'publish_tune', act)
|
||||
if act:
|
||||
listener = MusicTrackListener.get()
|
||||
if not self.music_track_changed_signal:
|
||||
listener = MusicTrackListener.get()
|
||||
self.music_track_changed_signal = listener.connect(
|
||||
'music-track-changed', self.music_track_changed)
|
||||
track = listener.get_playing_track()
|
||||
self.music_track_changed(listener, track)
|
||||
track = listener.get_playing_track()
|
||||
self.music_track_changed(listener, track)
|
||||
else:
|
||||
# disable it only if no other account use it
|
||||
for acct in gajim.connections:
|
||||
|
|
Loading…
Reference in New Issue