From 7370adb95c63496aca3dc198618fed75dafebc6c 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 | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index f106dd8..9905d2a 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 | |
| 360 | file_path = self.playlist[self.currentplaying]['url']\ |
| 361 | .replace('journal://', 'file://') |
| 362 | mimetype = mime.get_for_file(file_path) |
| 363 | |
| 364 | title = _('This file can\'t be played') |
| 365 | msg = _('Maybe the required plugin was not found ' |
| 366 | 'for this type of file "%s"') % mimetype |
| 367 | self._switch_canvas(False) |
| 368 | self._show_error_alert(title, msg) |
358 | 369 | |
359 | 370 | def _joined_cb(self, activity): |
360 | 371 | logging.debug("someone joined") |