use own image_preloaded()-method instead the one from the base-class, this one fixed...
authorThomas Schmidt <tschmidt@debian.org>
Sat, 17 Oct 2009 13:07:26 +0000 (15:07 +0200)
committerThomas Schmidt <tschmidt@debian.org>
Sat, 17 Oct 2009 13:07:26 +0000 (15:07 +0200)
canola-flickr/flickr/ui.py

index 530332d..911573f 100644 (file)
@@ -360,3 +360,37 @@ class ImageViewerController(BaseImageViewerController):
         self.reload_favorite_option_model()
         return res
 
+    def image_preloaded(self):
+        slideshow_active = self.is_slideshow_active()
+        self.stop_full_throbber()
+        self.view.show_image(slideshow_active)
+        try:
+            if self.slideshow_random:
+                if self.slideshow_loop:
+                    prev_idx = (self.slideshow_random_idx - 1) % len(self.slideshow_random_list)
+                    next_idx = (self.slideshow_random_idx + 1) % len(self.slideshow_random_list)
+
+                    prev = self.slideshow_random_list[prev_idx][1]
+                    next = self.slideshow_random_list[next_idx][1]
+                else:
+                    prev = self.slideshow_random_list[self.slideshow_random_idx - 1][1]
+                    next = self.slideshow_random_list[self.slideshow_random_idx + 1][1]
+            else:
+                prev = self.model.prev_get(circular=self.slideshow_loop)
+                next = self.model.next_get(circular=self.slideshow_loop)
+        except IndexError, ie:
+            if slideshow_active:
+                log.debug("Reached end of list. (self.slideshow_loop: %s)" % self.slideshow_loop)
+                return
+            else:
+                log.debug("Reached end of list.")
+                return
+
+        self.view.image_prev_next_preload(prev, next)
+
+        if slideshow_active:
+            self._slideshow_timer = \
+                ecore.timer_add(self.slideshow_time, self.load_next,
+                                self.slideshow_loop, self.image_preloaded)
+
+