diff --git a/quodlibet/quodlibet/ext/events/animosd.py b/quodlibet/quodlibet/ext/events/animosd.py index e6cc193521..340a95af4b 100644 --- a/quodlibet/quodlibet/ext/events/animosd.py +++ b/quodlibet/quodlibet/ext/events/animosd.py @@ -673,6 +673,11 @@ def plugin_on_song_started(self, song): window.show() window.fade_in() + def plugin_on_error(self, song, error): + if self.__current_window is not None: + self.__current_window.destroy() + self.__current_window = None + @staticmethod def start_fade_out(window): window.fade_out() diff --git a/quodlibet/quodlibet/player/__init__.py b/quodlibet/quodlibet/player/__init__.py index 3f045a7684..ae94921518 100644 --- a/quodlibet/quodlibet/player/__init__.py +++ b/quodlibet/quodlibet/player/__init__.py @@ -25,6 +25,9 @@ def __unicode__(self): return self.short_desc + ( u"\n" + self.long_desc if self.long_desc else u"") + def __str__(self): + return unicode(self).encode('utf-8') + def __repr__(self): return "%s(%r, %r)" % ( type(self).__name__, repr(self.short_desc), repr(self.long_desc)) diff --git a/quodlibet/quodlibet/plugins/events.py b/quodlibet/quodlibet/plugins/events.py index e9563d5f7a..8df72ac57a 100644 --- a/quodlibet/quodlibet/plugins/events.py +++ b/quodlibet/quodlibet/plugins/events.py @@ -30,6 +30,7 @@ class EventPlugin(object): obj.plugin_on_paused() obj.plugin_on_unpaused() obj.plugin_on_seek(song, msec) + obj.plugin_on_error(song, error) """ PLUGIN_INSTANCE = True @@ -79,7 +80,7 @@ def handler(librarian, *args): librarian.connect(event, handler, event) if librarian and player: - sigs = _map_signals(player, blacklist=("notify", "error")) + sigs = _map_signals(player, blacklist=("notify",)) for event, handle in sigs: def cb_handler(librarian, *args): self.__invoke(librarian, args[-1], *args[:-1]) diff --git a/quodlibet/quodlibet/qltk/quodlibetwindow.py b/quodlibet/quodlibet/qltk/quodlibetwindow.py index 2ba6631724..db81aff461 100644 --- a/quodlibet/quodlibet/qltk/quodlibetwindow.py +++ b/quodlibet/quodlibet/qltk/quodlibetwindow.py @@ -453,11 +453,15 @@ def delayed_song_set(): ('song-started', self.__song_started), ('paused', self.__update_paused, True), ('unpaused', self.__update_paused, False), - ('error', self.__player_error), ] for sig in player_sigs: gobject_weak(player.connect, *sig, **{"parent": self}) + # make sure we redraw all error indicators before opening + # a dialog (blocking the main loop), so connect after default handlers + gobject_weak(player.connect_after, 'error', + self.__player_error, **{"parent": self}) + # connect after to let SongTracker update stats player_sigs.append( gobject_weak(player.connect_after, "song-ended",