Author: mherger
Date: Wed Apr 14 07:40:33 2010
New Revision: 8699

URL: http://svn.slimdevices.com/jive?rev=8699&view=rev
Log:
Bug: 15925
Description: get rid of the confusing "auto" option to rotate images.

Modified:
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceServer.lua
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerMeta.lua
    7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/strings.txt

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceServer.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceServer.lua?rev=8699&r1=8698&r2=8699&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceServer.lua
 (original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageSourceServer.lua
 Wed Apr 14 07:40:33 2010
@@ -191,15 +191,12 @@
                
                -- if an image url has the {resizeParams} placeholder, add 
Squeezebox server resizing parameters
                local resizeParams = "_" .. screenWidth .. "x" .. screenHeight
-               local rotation = self.applet:getSettings()["rotation"]
 
                if self.applet:getSettings()["fullscreen"] then
                        resizeParams = resizeParams .. "_c"
 
                -- if the device can rotate (Jive) make sure we get whatever is 
the bigger ratio
-               elseif ( rotation == "yes" or (rotation == "auto" and 
System:hasDeviceRotation()) )
-                       and (screenWidth < screenHeight) then
-
+               elseif self.applet:getSettings()["rotation"] and (screenWidth < 
screenHeight) then
                        resizeParams = "_" .. screenHeight .. "x" .. 
(math.floor(screenHeight * screenHeight / screenWidth)) .. "_f"
                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=8699&r1=8698&r2=8699&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
 Wed Apr 14 07:40:33 2010
@@ -70,6 +70,14 @@
 local transitionBottomUp 
 local transitionLeftRight
 local transitionRightLeft
+
+function init(self)
+       -- migrate old <7.5.1 rotation value (yes|no|auto) to boolean
+       -- set to true if device can rotate and pref is set to auto or yes
+       local rotation = tostring(self:getSettings()["rotation"])
+       local deviceCanRotate = System:hasDeviceRotation()
+       self:setRotation(deviceCanRotate and (rotation == "true" or rotation == 
"yes" or rotation == "auto"))
+end
 
 function initImageSource(self, imgSourceOverride)
        log:info("init image viewer")
@@ -562,13 +570,7 @@
 function _renderImage(self)
        -- get device orientation and features
        local screenWidth, screenHeight = Framework:getScreenSize()
-       local deviceCanRotate = false
-       
-       -- FIXME: better detection for device type
-       if System:hasDeviceRotation() then
-               -- Jive device
-               deviceCanRotate = true
-       end
+       
        local rotation = self:getSettings()["rotation"]
        local fullScreen = self:getSettings()["fullscreen"]
        local ordering = self:getSettings()["ordering"]
@@ -594,7 +596,7 @@
                        local imageLandscape = ((w/h) > 1)
 
                        -- determine whether to rotate
-                       if (rotation == "yes") or (rotation == "auto" and 
deviceCanRotate) then
+                       if rotation then
                                -- rotation allowed
                                if deviceLandscape != imageLandscape then
                                        -- rotation needed, so let's do it
@@ -1184,33 +1186,21 @@
                     "radio",
                     group,
                     function()
-                        self:setRotation("yes")
+                        self:setRotation(true)
                     end,
-                    rotation == "yes"
+                    rotation
                    ),
             },
             {
-                text = self:string("IMAGE_VIEWER_ROTATION_AUTO"),
+                text = self:string("IMAGE_VIEWER_ROTATION_NO"),
                style = 'item_choice',
                 check = RadioButton(
                     "radio",
                     group,
                     function()
-                        self:setRotation("auto")
+                        self:setRotation(false)
                     end,
-                    rotation == "auto"
-                   ),
-            },           
-            {
-                text = self:string("IMAGE_VIEWER_ROTATION_NO"),
-               style = 'item_choice',
-                check = RadioButton(
-                    "radio",
-                    group,
-                    function()
-                        self:setRotation("no")
-                    end,
-                    rotation == "no"
+                    not rotation
                    ),
             },           
                }))

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerMeta.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerMeta.lua?rev=8699&r1=8698&r2=8699&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerMeta.lua
 (original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/ImageViewerMeta.lua
 Wed Apr 14 07:40:33 2010
@@ -52,7 +52,7 @@
 function defaultSettings(self)
        local defaultSetting = {}
        defaultSetting["delay"] = 10000
-       defaultSetting["rotation" ] = "auto"
+       defaultSetting["rotation"] = System:hasDeviceRotation()
        defaultSetting["fullscreen"] = false
        defaultSetting["transition"] = "fade"
        defaultSetting["ordering"] = "sequential"

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/strings.txt
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/strings.txt?rev=8699&r1=8698&r2=8699&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/strings.txt 
(original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/applets/ImageViewer/strings.txt 
Wed Apr 14 07:40:33 2010
@@ -501,8 +501,8 @@
 IMAGE_VIEWER_ROTATION
        CS      Automatické otáčení
        DA      Automatisk rotation
-       DE      Automatisch drehen
-       EN      Auto-rotate
+       DE      Bilder drehen
+       EN      Image rotation
        ES      Autogirar
        FI      Käännä automaattisesti
        FR      Rotation automatique
@@ -516,8 +516,8 @@
 IMAGE_VIEWER_ROTATION_YES
        CS      Vždy otáčet
        DA      Rotér altid
-       DE      Immer drehen
-       EN      Always rotate
+       DE      Bilder drehen
+       EN      Rotate images
        ES      Girar siempre
        FI      Käännä aina
        FR      Toujours faire pivoter
@@ -527,21 +527,6 @@
        PL      Zawsze obracaj
        RU      Всегда поворачивать
        SV      Rotera alltid
-
-IMAGE_VIEWER_ROTATION_AUTO
-       CS      Otáčení pouze u mobilních zařízení
-       DA      Rotation kun på mobilenheder
-       DE      Drehung nur auf Mobilgeräten
-       EN      Rotation on mobile devices only
-       ES      Giro sólo en dispositivos móviles
-       FI      Kääntäminen ainoastaan mobiililaitteissa
-       FR      Rotation uniquement sur les dispositifs mobiles
-       IT      Rotazione solo sui dispositivi portatili
-       NL      Alleen rotatie op mobiele apparaten
-       NO      Rotering kun på bærbare enheter
-       PL      Obracanie tylko na urządzeniach mobilnych
-       RU      Поворот только на мобильных 
устройствах
-       SV      Rotation endast på mobila enheter
 
 IMAGE_VIEWER_ROTATION_NO
        CS      Bez otáčení

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

Reply via email to