mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-10 21:22:39 +01:00
aefaef
This commit is contained in:
parent
e932b3d49f
commit
58fe2d9508
@ -241,7 +241,7 @@
|
||||
path="/lib/MineOSCore.lua",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/MineOSCore.lua",
|
||||
type="Library",
|
||||
version=1.72,
|
||||
version=1.73,
|
||||
},
|
||||
{
|
||||
path="/lib/advancedLua.lua",
|
||||
|
||||
@ -1199,19 +1199,21 @@ function MineOSCore.newFileFromURL(parentWindow, path)
|
||||
|
||||
container.inputFieldURL = container.layout:addChild(GUI.inputField(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, nil, "URL", false))
|
||||
container.inputField.onInputFinished = function()
|
||||
if fs.exists(path .. container.inputField.text) then
|
||||
container.label.hidden = false
|
||||
parentWindow:draw()
|
||||
buffer.draw()
|
||||
else
|
||||
if container.inputFieldURL.text then
|
||||
local success, reason = require("web").downloadFile(container.inputFieldURL.text, path .. container.inputField.text)
|
||||
if not success then
|
||||
GUI.error(reason)
|
||||
end
|
||||
if container.inputField.text then
|
||||
if fs.exists(path .. container.inputField.text) then
|
||||
container.label.hidden = false
|
||||
parentWindow:draw()
|
||||
buffer.draw()
|
||||
else
|
||||
if container.inputFieldURL.text then
|
||||
local success, reason = require("web").downloadFile(container.inputFieldURL.text, path .. container.inputField.text)
|
||||
if not success then
|
||||
GUI.error(reason)
|
||||
end
|
||||
|
||||
container:delete()
|
||||
computer.pushSignal("MineOSCore", "updateFileList")
|
||||
container:delete()
|
||||
computer.pushSignal("MineOSCore", "updateFileList")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user