diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-11-01 18:32:27 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-11-02 21:01:55 (GMT) |
commit | 867c2d08570a5dc9a506071e84103612f4929320 (patch) | |
tree | 40209e9b48a7aef2b32ff34ee3b2499bc6d09399 | |
parent | 17bb41d2dea86394d0f9c8d0952ccd135bf7038c (diff) |
Error message improved
A bit of style to the Error Alert that says GStreamer is not able to
play a media file because of a plug-in is missing.
Changed error msg as suggested by Gary Martin
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r-- | jukeboxactivity.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py index f106dd8..152baf2 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -304,9 +304,11 @@ class JukeboxActivity(activity.Activity): def _player_eos_cb(self, widget): self.songchange('next') - def _show_error_alert(self, title): + def _show_error_alert(self, title, msg=None): alert = ErrorAlert() alert.props.title = title + if msg is not None: + alert.props.msg = msg self.add_alert(alert) alert.connect('response', self._alert_cancel_cb) alert.show() @@ -354,7 +356,15 @@ class JukeboxActivity(activity.Activity): self.player.stop() self.player.set_uri(None) self.control.set_disabled() - self._show_error_alert("Error: %s - %s" % (message, detail)) + + file_path = self.playlist[self.currentplaying]['url']\ + .replace('journal://', 'file://') + mimetype = mime.get_for_file(file_path) + + title = _('Error') + msg = _('This "%s" file can\'t be played') % mimetype + self._switch_canvas(False) + self._show_error_alert(title, msg) def _joined_cb(self, activity): logging.debug("someone joined") |