1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-12-25 10:28:06 +11:00

r7: Fix the read-only-FS filemanager bug AmandaC found

This should fix everything
This commit is contained in:
20kdc 2018-12-11 16:09:54 +00:00
parent efae7716da
commit 375995c2d3
3 changed files with 27 additions and 26 deletions

View File

@ -67,7 +67,7 @@ return {
},
["neo-icecap"] = {
desc = "KittenOS NEO / Icecap",
v = 3,
v = 7,
deps = {
"neo"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -97,6 +97,15 @@ function getFsNode(fs, parent, fsc, path, mode)
n[k + 1] = {nm, function () return nil, getFsNode(fs, t, fsc, fp, mode) end}
end
end
if not dir then
table.insert(n, {"Copy", function ()
local rt, re = require("sys-filewrap").create(fsc, path, false)
if not rt then
return false, dialog("Open Error: " .. tostring(re), parent)
end
return nil, setupCopyVirtualEnvironment(fs, parent, rt, path:match("[^/]*$") or "")
end})
end
if fscrw then
if dir then
table.insert(n, {"Mk. Directory", function ()
@ -114,31 +123,6 @@ function getFsNode(fs, parent, fsc, path, mode)
end
}
end})
else
if mode ~= nil then
local tx = "Open"
if mode == true then
tx = "Save"
elseif mode == "append" then
tx = "Append"
end
if fscrw or mode == false then
table.insert(n, {tx, function ()
local rt, re = require("sys-filewrap").create(fsc, path, mode)
if not rt then
return false, dialog("Open Error: " .. tostring(re), parent)
end
return true, rt
end})
end
end
table.insert(n, {"Copy", function ()
local rt, re = require("sys-filewrap").create(fsc, path, false)
if not rt then
return false, dialog("Open Error: " .. tostring(re), parent)
end
return nil, setupCopyVirtualEnvironment(fs, parent, rt, path:match("[^/]*$") or "")
end})
end
if path ~= "/" then
local delText = "Delete"
@ -172,6 +156,23 @@ function getFsNode(fs, parent, fsc, path, mode)
end})
end
end
if (fscrw or mode == false) and mode ~= nil then
local tx = "Open"
if mode == true then
tx = "Save"
elseif mode == "append" then
tx = "Append"
end
if fscrw or mode == false then
table.insert(n, {tx, function ()
local rt, re = require("sys-filewrap").create(fsc, path, mode)
if not rt then
return false, dialog("Open Error: " .. tostring(re), parent)
end
return true, rt
end})
end
end
return n
end,
unknownAvailable = dir and (mode ~= nil) and ((mode == false) or fscrw),