diff --git a/src/gpodder/gtkui/frmntl/preferences.py b/src/gpodder/gtkui/frmntl/preferences.py index eaa99471..30e150e3 100644 --- a/src/gpodder/gtkui/frmntl/preferences.py +++ b/src/gpodder/gtkui/frmntl/preferences.py @@ -51,11 +51,13 @@ class gPodderPreferences(BuilderWidget): AUDIO_PLAYERS = ( ('default', _('Media Player')), ('panucci', _('Panucci')), + ('MediaBox', _('MediaBox')), ) VIDEO_PLAYERS = ( ('default', _('Media Player')), ('mplayer', _('MPlayer')), + ('MediaBox', _('MediaBox')), ) def new(self): diff --git a/src/gpodder/gtkui/maemo/preferences.py b/src/gpodder/gtkui/maemo/preferences.py index e49f3fe3..cbcb8107 100644 --- a/src/gpodder/gtkui/maemo/preferences.py +++ b/src/gpodder/gtkui/maemo/preferences.py @@ -35,10 +35,12 @@ class gPodderPreferences(BuilderWidget): audio_players = [ ('default', 'Media Player'), ('panucci', 'Panucci'), + ('MediaBox', _('MediaBox')), ] video_players = [ ('default', 'Media Player'), ('mplayer', 'MPlayer'), + ('MediaBox', _('MediaBox')), ] def new(self): diff --git a/src/gpodder/gui.py b/src/gpodder/gui.py index 8991e8d9..eba68e2c 100644 --- a/src/gpodder/gui.py +++ b/src/gpodder/gui.py @@ -2142,6 +2142,28 @@ class gPodder(BuilderWidget, dbus.service.Object): continue # This file was handled by the D-Bus call except Exception, e: log('Error calling Panucci using D-Bus', sender=self, traceback=True) + elif player == 'MediaBox' and gpodder.ui.maemo: + try: + MEDIABOX_NAME = 'de.pycage.mediabox' + MEDIABOX_PATH = '/de/pycage/mediabox/control' + MEDIABOX_INTF = 'de.pycage.mediabox.control' + session_bus = dbus.SessionBus(mainloop=dbus.glib.DBusGMainLoop()) + o = session_bus.get_object(MEDIABOX_NAME, MEDIABOX_PATH) + i = dbus.Interface(o, MEDIABOX_INTF) + + def on_reply(*args): + pass + + def on_error(err): + log('Exception in D-Bus call: %s', str(err), \ + sender=self) + + i.load(filename, '%s/x-unknown' % file_type, \ + reply_handler=on_reply, error_handler=on_error) + + continue # This file was handled by the D-Bus call + except Exception, e: + log('Error calling MediaBox using D-Bus', sender=self, traceback=True) groups[player].append(filename)