Author: titmuss
Date: Wed Nov 26 14:46:02 2008
New Revision: 3450

URL: http://svn.slimdevices.com?rev=3450&root=Jive&view=rev
Log:
Bug: N/A
Description:
Update log and screenshot applets, after the SD card mount point has moved to 
/media/*/.


Modified:
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/LogSettings/LogSettingsMeta.lua
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/LogSettings/LogSettingsMeta.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/LogSettings/LogSettingsMeta.lua?rev=3450&root=Jive&r1=3449&r2=3450&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/LogSettings/LogSettingsMeta.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/LogSettings/LogSettingsMeta.lua
 Wed Nov 26 14:46:02 2008
@@ -35,9 +35,17 @@
 
 
 function registerApplet(meta)
-       -- only make this available if an SD card is slotted in and a 
/mnt/mmc/log directory is present
-       local SDCARD_PATH = "/mnt/mmc/log"
-       if lfs.attributes(SDCARD_PATH, "mode") == "directory" then
+       -- only make this available if an SD card is slotted in and
+       -- a /media/*/log directory is present
+       local media = false
+       for dir in lfs.dir("/media") do
+               if lfs.attributes("/media/" .. dir .. "/log", "mode") == 
"directory" then
+                       media = true
+                       break
+               end
+       end
+
+       if media then
                jiveMain:addItem(meta:menuItem('appletLogSettings', 
'advancedSettings', 'DEBUG_LOG', function(applet, ...) applet:logSettings(...) 
end))
        end
 end

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua?rev=3450&root=Jive&r1=3449&r2=3450&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
 Wed Nov 26 14:46:02 2008
@@ -20,7 +20,7 @@
 -- stuff we use
 local oo               = require("loop.simple")
 local string           = require("string")
-local io               = io
+local lfs              = require("lfs")
 
 local Applet           = require("jive.Applet")
 local Framework        = require("jive.ui.Framework")
@@ -40,23 +40,19 @@
        if event:getKeycode() == (KEY_REW | KEY_PAUSE) then
                Framework:playSound("CLICK")
 
-               local file = string.format("jive%04d.bmp", self.number)
+               -- write to /media/*/log/squeezeplayXXXX.bmp or userpath
+               local path = Framework.getUserPath()
+               for dir in lfs.dir("/media") do
+                       local tmp = "/media/" .. dir .. "/log"
+                       if lfs.attributes(tmp, "mode") == "directory" then
+                               path = tmp
+                               break
+                       end
+               end
+
+               local file = path .. string.format("/squeezeplay%04d.bmp", 
self.number)
                self.number = self.number + 1
                
-               local mounts = io.open('/proc/mounts')
-               while true do
-                       local line = mounts:read()
-
-                       if not line then
-                               break
-                       end
-
-                       if string.match(line, '/mnt/mmc') then
-                               file = '/mnt/mmc/'..file
-                       end
-               end
-               mounts:close()
-
                log:warn("Taking screenshot " .. file)
 
                -- take screenshot

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

Reply via email to