Ticket #1548: 0001-Error-message-improved.patch

File 0001-Error-message-improved.patch, 1.7 KB (added by humitos, 11 years ago)
  • jukeboxactivity.py

    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): 
    304304    def _player_eos_cb(self, widget):
    305305        self.songchange('next')
    306306
    307     def _show_error_alert(self, title):
     307    def _show_error_alert(self, title, msg=None):
    308308        alert = ErrorAlert()
    309309        alert.props.title = title
     310        if msg is not None:
     311            alert.props.msg = msg
    310312        self.add_alert(alert)
    311313        alert.connect('response', self._alert_cancel_cb)
    312314        alert.show()
    class JukeboxActivity(activity.Activity): 
    354356        self.player.stop()
    355357        self.player.set_uri(None)
    356358        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)
    358367
    359368    def _joined_cb(self, activity):
    360369        logging.debug("someone joined")