mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
fixed error on disconnect
This commit is contained in:
parent
8e4ba7ef10
commit
9285d18a5c
@ -1132,6 +1132,7 @@ class AlbumIconView(Gtk.IconView): #TODO function/var names
|
||||
genre=self.genre_select.get_value()
|
||||
artist_type=self.settings.get_artist_type()
|
||||
for artist in artists:
|
||||
try: #client cloud meanwhile disconnect
|
||||
if not self.stop_flag:
|
||||
if genre == None:
|
||||
album_candidates=self.client.list("album", artist_type, artist)
|
||||
@ -1147,6 +1148,9 @@ class AlbumIconView(Gtk.IconView): #TODO function/var names
|
||||
else:
|
||||
GLib.idle_add(self.emit, "done")
|
||||
return
|
||||
except:
|
||||
GLib.idle_add(self.emit, "done")
|
||||
return
|
||||
#display albums
|
||||
self.store.set_sort_column_id(Gtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, Gtk.SortType.ASCENDING)
|
||||
music_lib=self.settings.get_value("paths")[self.settings.get_int("active-profile")]
|
||||
@ -1256,8 +1260,12 @@ class AlbumView(Gtk.ScrolledWindow):
|
||||
self.add(self.iconview)
|
||||
|
||||
def clear(self, *args):
|
||||
if self.done:
|
||||
self.artists=[]
|
||||
self.iconview.store.clear()
|
||||
elif not self.clear in self.pending:
|
||||
self.iconview.stop_flag=True
|
||||
self.pending.append(self.clear)
|
||||
|
||||
def refresh(self, artists):
|
||||
self.artists=artists
|
||||
@ -1684,6 +1692,7 @@ class Browser(Gtk.Box):
|
||||
self.paned2.set_position(self.settings.get_int("paned2"))
|
||||
|
||||
def clear(self, *args):
|
||||
self.genre_select.clear()
|
||||
self.artist_view.clear()
|
||||
self.album_view.clear()
|
||||
self.playlist_view.clear()
|
||||
@ -1727,10 +1736,10 @@ class Browser(Gtk.Box):
|
||||
self.genre_select.set_sensitive(True)
|
||||
|
||||
def on_disconnected(self, *args):
|
||||
self.clear()
|
||||
self.back_to_album_button.set_sensitive(False)
|
||||
self.search_button.set_active(False)
|
||||
self.search_button.set_sensitive(False)
|
||||
self.genre_select.clear()
|
||||
self.genre_select.set_sensitive(False)
|
||||
|
||||
def on_artists_changed(self, *args):
|
||||
@ -2958,7 +2967,6 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||
self.lyrics_button.set_active(False)
|
||||
self.set_title("mpdevil (not connected)")
|
||||
self.songid_playing=None
|
||||
self.browser.clear()
|
||||
self.progress.set_sensitive(False)
|
||||
self.control.set_sensitive(False)
|
||||
self.play_opts.set_sensitive(False)
|
||||
|
Loading…
Reference in New Issue
Block a user