Update settings.lua
This commit is contained in:
parent
319cb28ffe
commit
09d33d49d0
1 changed files with 23 additions and 9 deletions
|
@ -357,20 +357,34 @@ local function defaultApps()
|
||||||
elseif id == 1 then
|
elseif id == 1 then
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
local defaultHome = sPhone.list()
|
local hList = {
|
||||||
|
["sphone.home"] = "sPhone Home",
|
||||||
|
}
|
||||||
|
|
||||||
|
for k,v in pairs(config.list("/.sPhone/config/spklist")) do
|
||||||
|
local f = fs.open("/.sPhone/apps/spk/"..k.."/.spk","r")
|
||||||
|
local data = f.readAll()
|
||||||
|
f.close()
|
||||||
|
data = textutils.unserialise(data)
|
||||||
|
if data.type == "home" then
|
||||||
|
hList[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local defaultHome = sPhone.list(nil,{
|
||||||
|
list = hList,
|
||||||
|
pairs = true,
|
||||||
|
title = " Default Home",
|
||||||
|
})
|
||||||
|
|
||||||
if not defaultHome then
|
if not defaultHome then
|
||||||
sPhone.setDefaultApp("home","/.sPhone/apps/home")
|
sPhone.setDefaultApp("home","sphone.home")
|
||||||
sPhone.winOk("Done!","Reboot to apply")
|
sPhone.winOk("Done!","Reboot to apply")
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
if fs.exists("/"..defaultHome) and not fs.isDir("/"..defaultHome) then
|
sPhone.setDefaultApp("home",defaultHome)
|
||||||
sPhone.setDefaultApp("home","/"..defaultHome)
|
|
||||||
sPhone.winOk("Done!","Reboot to apply")
|
sPhone.winOk("Done!","Reboot to apply")
|
||||||
break
|
break
|
||||||
else
|
|
||||||
sPhone.winOk("App not found")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue