mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-11-23 10:58:06 +11:00
r7: Fix the read-only-FS filemanager bug AmandaC found
This should fix everything
This commit is contained in:
parent
efae7716da
commit
375995c2d3
@ -67,7 +67,7 @@ return {
|
|||||||
},
|
},
|
||||||
["neo-icecap"] = {
|
["neo-icecap"] = {
|
||||||
desc = "KittenOS NEO / Icecap",
|
desc = "KittenOS NEO / Icecap",
|
||||||
v = 3,
|
v = 7,
|
||||||
deps = {
|
deps = {
|
||||||
"neo"
|
"neo"
|
||||||
},
|
},
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@ -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}
|
n[k + 1] = {nm, function () return nil, getFsNode(fs, t, fsc, fp, mode) end}
|
||||||
end
|
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 fscrw then
|
||||||
if dir then
|
if dir then
|
||||||
table.insert(n, {"Mk. Directory", function ()
|
table.insert(n, {"Mk. Directory", function ()
|
||||||
@ -114,31 +123,6 @@ function getFsNode(fs, parent, fsc, path, mode)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
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
|
end
|
||||||
if path ~= "/" then
|
if path ~= "/" then
|
||||||
local delText = "Delete"
|
local delText = "Delete"
|
||||||
@ -172,6 +156,23 @@ function getFsNode(fs, parent, fsc, path, mode)
|
|||||||
end})
|
end})
|
||||||
end
|
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
|
return n
|
||||||
end,
|
end,
|
||||||
unknownAvailable = dir and (mode ~= nil) and ((mode == false) or fscrw),
|
unknownAvailable = dir and (mode ~= nil) and ((mode == false) or fscrw),
|
||||||
|
Loading…
Reference in New Issue
Block a user