Author: michael
Date: Tue Jan 12 10:34:29 2010
New Revision: 8318

URL: http://svn.slimdevices.com/jive?rev=8318&view=rev
Log:
Bug: n/a
Description: don't animate slideshows with only one item

Modified:
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSource.lua
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSource.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSource.lua?rev=8318&r1=8317&r2=8318&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSource.lua 
(original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSource.lua 
Tue Jan 12 10:34:29 2010
@@ -143,5 +143,9 @@
        return self.imgFiles[self.currentImage]
 end
 
+function getImageCount(self)
+       return #self.imgFiles
+end
+
 function free(self)
 end

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua?rev=8318&r1=8317&r2=8318&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua
 (original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua
 Tue Jan 12 10:34:29 2010
@@ -547,13 +547,16 @@
                --no iconbar
                self.window:setShowFrameworkWidgets(false)
 
-               -- start timer for next photo in 'delay' milliseconds
-               local delay = self:getSettings()["delay"]
-               self.nextSlideTimer = self.window:addTimer(delay,
-                       function()
-                               
self.imgSource:nextImage(self:getSettings()["ordering"])
-                               self:displaySlide()
-                       end)
+               -- if we have more than one picture, start slideshow
+               if self.imgSource:getImageCount() > 1 then
+                       -- start timer for next photo in 'delay' milliseconds
+                       local delay = self:getSettings()["delay"]
+                       self.nextSlideTimer = self.window:addTimer(delay,
+                               function()
+                                       
self.imgSource:nextImage(self:getSettings()["ordering"])
+                                       self:displaySlide()
+                               end)
+               end
        else
                file = self.imgSource:getCurrentImagePath() or 'unknown'
                log:info("Invalid image object found: " .. file)

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to