From e9715b3126f2cb1ad531e201575569fba4fae205 Mon Sep 17 00:00:00 2001
From: Manuel Kaufmann <humitos@gmail.com>
Date: Thu, 1 Nov 2012 15:32:27 -0300
Subject: [PATCH Jukebox] 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.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
jukeboxactivity.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index f106dd8..d25581a 100644
a
|
b
|
class JukeboxActivity(activity.Activity): |
304 | 304 | def _player_eos_cb(self, widget): |
305 | 305 | self.songchange('next') |
306 | 306 | |
307 | | def _show_error_alert(self, title): |
| 307 | def _show_error_alert(self, title, msg=None): |
308 | 308 | alert = ErrorAlert() |
309 | 309 | alert.props.title = title |
| 310 | if msg is not None: |
| 311 | alert.props.msg = msg |
310 | 312 | self.add_alert(alert) |
311 | 313 | alert.connect('response', self._alert_cancel_cb) |
312 | 314 | alert.show() |
… |
… |
class JukeboxActivity(activity.Activity): |
354 | 356 | self.player.stop() |
355 | 357 | self.player.set_uri(None) |
356 | 358 | self.control.set_disabled() |
357 | | self._show_error_alert("Error: %s - %s" % (message, detail)) |
| 359 | msg = None |
| 360 | if 'missing a plug-in' in message: |
| 361 | # there is no specific type for 'plug-in missing', so we |
| 362 | # check that in the message itself |
| 363 | msg = _('This media file can\'t be played without ' |
| 364 | 'the required plug-in installed.') |
| 365 | self._switch_canvas(False) |
| 366 | self._show_error_alert(message, msg) |
358 | 367 | |
359 | 368 | def _joined_cb(self, activity): |
360 | 369 | logging.debug("someone joined") |