mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
fixed bug in LyricsWindow causing delays
This commit is contained in:
parent
7f015800a1
commit
d2861673bd
@ -1792,7 +1792,7 @@ class Search(Gtk.Dialog):
|
|||||||
self.store.append([track, title, artist, album, duration, song["file"].replace("&", "")] )
|
self.store.append([track, title, artist, album, duration, song["file"].replace("&", "")] )
|
||||||
self.label.set_text(_("Hits: %i") % (len(self.store)))
|
self.label.set_text(_("Hits: %i") % (len(self.store)))
|
||||||
|
|
||||||
class LyricsWindow(Gtk.Window): #Lyrics view with own client because MPDClient isn't threadsafe
|
class LyricsWindow(Gtk.Window):
|
||||||
def __init__(self, client, settings, emitter):
|
def __init__(self, client, settings, emitter):
|
||||||
Gtk.Window.__init__(self, title=_("Lyrics"))
|
Gtk.Window.__init__(self, title=_("Lyrics"))
|
||||||
self.set_icon_name("mpdevil")
|
self.set_icon_name("mpdevil")
|
||||||
@ -1813,6 +1813,7 @@ class LyricsWindow(Gtk.Window): #Lyrics view with own client because MPDClient i
|
|||||||
|
|
||||||
#connect
|
#connect
|
||||||
self.player_changed=self.emitter.connect("player", self.update)
|
self.player_changed=self.emitter.connect("player", self.update)
|
||||||
|
self.connect("destroy", self.remove_handlers)
|
||||||
|
|
||||||
#packing
|
#packing
|
||||||
self.scroll.add(self.label)
|
self.scroll.add(self.label)
|
||||||
@ -1822,6 +1823,9 @@ class LyricsWindow(Gtk.Window): #Lyrics view with own client because MPDClient i
|
|||||||
|
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
def remove_handlers(self, *args):
|
||||||
|
self.emitter.disconnect(self.player_changed)
|
||||||
|
|
||||||
def display_lyrics(self):
|
def display_lyrics(self):
|
||||||
GLib.idle_add(self.label.set_text, _("searching..."))
|
GLib.idle_add(self.label.set_text, _("searching..."))
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user