From ddec2a43c8961246086e9db07a5791e2a7eae6c2 Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Fri, 4 Sep 2009 22:29:04 +0300 Subject: [PATCH] Skip empty image If we cannot download one of the images, don't add an stock icon, so next image gets the correct position. --- src/aa_selection_dialog.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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() -- 1.7.9.5