From 70a0c57e35d54ef9a5ec4678caf97cc6ca00a7a4 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Wed, 7 Mar 2018 08:08:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B7=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D0=BF=D0=BE=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/MineOSInterface.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/MineOSInterface.lua b/lib/MineOSInterface.lua index 2d4e7ffa..983d527e 100755 --- a/lib/MineOSInterface.lua +++ b/lib/MineOSInterface.lua @@ -1008,27 +1008,27 @@ function MineOSInterface.newFileFromURL(parentWindow, iconField, x, y, path) local container = addUniversalContainerWithInputTextBox(parentWindow, nil, "Загрузить файл по URL", MineOSCore.localization.fileName) container.inputFieldURL = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x696969, 0xE1E1E1, 0x2D2D2D, nil, "URL", false)) - container.inputField.onInputFinished = function() - if container.inputField.text then - if fs.exists(path .. container.inputField.text) then + container.panel.eventHandler = function(mainContainer, object, eventData) + if eventData[1] == "touch" then + if fs.exists(container.inputField.text) then container.label.hidden = false - parentWindow:draw() + mainContainer:draw() buffer.draw() else - if container.inputFieldURL.text then - local success, reason = require("web").download(container.inputFieldURL.text, path .. container.inputField.text) - if not success then - GUI.error(reason) - end + local success, reason = require("web").download(container.inputFieldURL.text, path .. container.inputField.text) + container:delete() - container:delete() + if success then checkIconConfigCanSavePosition(iconField, x, y, container.inputField.text) computer.pushSignal("MineOSCore", "updateFileList") + else + GUI.error(reason) + mainContainer:draw() + buffer.draw() end end end end - container.inputFieldURL.onInputFinished = container.inputField.onInputFinished parentWindow:draw() buffer.draw()