Index: src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua =================================================================== --- src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua (revision 7862) +++ src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua (working copy) @@ -27,6 +27,7 @@ local io = require("io") local table = require("jive.utils.table") local string = require("jive.utils.string") +local os = require("os") local Applet = require("jive.Applet") local System = require("jive.System") @@ -115,10 +116,15 @@ local screenWidth, screenHeight = Framework:getScreenSize() log:warn(screenWidth, '|', screenHeight) + if string.match(os.getenv("OS") or "", "Windows") then + isWin = 1 + end + -- read all files in the wallpaper/ directory and into self.wallpapers -- this step is done first so images aren't read twice, -- once from source area and once from build area - for img in self:readdir("wallpaper") do + for img in self:readdir("wallpaper", isWin) do + -- split the fullpath into a table on / local fullpath = string.split('/', img) -- the filename is the last element in the fullpath table Index: src/squeezeplay/share/jive/Applet.lua =================================================================== --- src/squeezeplay/share/jive/Applet.lua (revision 7862) +++ src/squeezeplay/share/jive/Applet.lua (working copy) @@ -99,12 +99,23 @@ end -local function dirIter(self, path) +local function dirIter(self, path, isWin) local rpath = "applets/" .. self._entry.appletName .. "/" .. path .. "/" + + if isWin then + rpath = "applets\\" .. self._entry.appletName .. "\\" .. path + end + + for dir in package.path:gmatch("([^;]*)%?[^;]*;") do dir = dir .. rpath local mode = lfs.attributes(dir, "mode") + + if isWin then + rpath = rpath .. "/" + end + if mode == "directory" then for entry in lfs.dir(dir) do if entry ~= "." and entry ~= ".." and entry ~= ".svn" then @@ -120,8 +131,8 @@ An iterator over the applets files in path. --]] -function readdir(self, path) - local co = coroutine.create(function() dirIter(self, path) end) +function readdir(self, path, isWin) + local co = coroutine.create(function() dirIter(self, path, isWin) end) return function() local code, res = coroutine.resume(co) return res