From: Ivan Frade Date: Fri, 4 Sep 2009 19:29:04 +0000 (+0300) Subject: Skip empty image X-Git-Tag: mussorgsky-0.2.1-1~4 X-Git-Url: https://vcs.maemo.org/git/?p=mussorgsky;a=commitdiff_plain;h=ddec2a43c8961246086e9db07a5791e2a7eae6c2 Skip empty image If we cannot download one of the images, don't add an stock icon, so next image gets the correct position. --- diff --git a/src/aa_selection_dialog.py b/src/aa_selection_dialog.py index 6d19fce..50fcae6 100644 --- a/src/aa_selection_dialog.py +++ b/src/aa_selection_dialog.py @@ -1,7 +1,7 @@ import hildon import gtk import gobject -from album_art import MussorgskyAlbumArt +from album_art_thread import MussorgskyAlbumArt class AlbumArtSelectionDialog (gtk.Dialog): @@ -56,12 +56,16 @@ class AlbumArtSelectionDialog (gtk.Dialog): def __get_alternatives_async (self): counter = 0 for (path, thumb) in self.downloader.get_alternatives (self.album, self.artist, self.size): + print path, thumb if (self.cancel): return False self.paths.insert (counter, (path, thumb)) - print "Setting", thumb, "as image" - self.images[counter].set_from_file (thumb) - self.event_boxes [counter].set_sensitive (True) + if (thumb): + print "Setting", thumb, "as image" + self.images[counter].set_from_file (thumb) + self.event_boxes [counter].set_sensitive (True) + else: + continue counter += 1 while (gtk.events_pending()): gtk.main_iteration()