From 58fe2d95080d7efdeb8bd71ed80c0dbc3522ac43 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Thu, 24 Aug 2017 13:18:48 +0300 Subject: [PATCH] aefaef --- Applications.cfg | 2 +- lib/MineOSCore.lua | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Applications.cfg b/Applications.cfg index 7bcc10d2..949f008a 100644 --- a/Applications.cfg +++ b/Applications.cfg @@ -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", diff --git a/lib/MineOSCore.lua b/lib/MineOSCore.lua index c97df3c5..2c8b6ca2 100755 --- a/lib/MineOSCore.lua +++ b/lib/MineOSCore.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