do not fail because of music track listener if user does not have D-Bus bindings
This commit is contained in:
parent
e9a6b7c108
commit
70a28b4724
|
@ -14,6 +14,8 @@
|
||||||
## GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
##
|
##
|
||||||
import gobject
|
import gobject
|
||||||
|
import dbus_support
|
||||||
|
if dbus_support.supported:
|
||||||
import dbus
|
import dbus
|
||||||
import dbus.glib
|
import dbus.glib
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ from message_window import MessageWindowMgr
|
||||||
from chat_control import ChatControl
|
from chat_control import ChatControl
|
||||||
from groupchat_control import GroupchatControl
|
from groupchat_control import GroupchatControl
|
||||||
from groupchat_control import PrivateChatControl
|
from groupchat_control import PrivateChatControl
|
||||||
|
|
||||||
|
import dbus_support
|
||||||
|
if dbus_support.supported:
|
||||||
from music_track_listener import MusicTrackListener
|
from music_track_listener import MusicTrackListener
|
||||||
|
|
||||||
#(icon, name, type, jid, account, editable, second pixbuf)
|
#(icon, name, type, jid, account, editable, second pixbuf)
|
||||||
|
@ -2389,6 +2392,8 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
'''if enabled is True, we listen to events from music players about
|
'''if enabled is True, we listen to events from music players about
|
||||||
currently played music track, and we update our
|
currently played music track, and we update our
|
||||||
status message accordinly'''
|
status message accordinly'''
|
||||||
|
if not dbus_support.supported: # do nothing if we haven't D-Bus running
|
||||||
|
return
|
||||||
if enabled:
|
if enabled:
|
||||||
if self._music_track_changed_signal is None:
|
if self._music_track_changed_signal is None:
|
||||||
listener = MusicTrackListener.get()
|
listener = MusicTrackListener.get()
|
||||||
|
|
Loading…
Reference in New Issue