From 18ebe258b95bfbbb1913e0941df733e7bc9fdae2 Mon Sep 17 00:00:00 2001 From: IgorTimofeev Date: Thu, 4 May 2023 18:13:05 +0300 Subject: [PATCH 1/2] Fixed weird screen library bug & updated traceback analysis method --- Libraries/GUI.lua | 8 +++++++- Libraries/Screen.lua | 17 ++++++---------- Libraries/System.lua | 38 ++++++++++++++++------------------- Localizations/Arabic.lang | 2 -- Localizations/Belarusian.lang | 2 -- Localizations/Bengali.lang | 2 -- Localizations/Bulgarian.lang | 2 -- Localizations/Chinese.lang | 2 -- Localizations/Dutch.lang | 2 -- Localizations/English.lang | 2 -- Localizations/Finnish.lang | 2 -- Localizations/French.lang | 2 -- Localizations/German.lang | 2 -- Localizations/Hindi.lang | 2 -- Localizations/Italian.lang | 2 -- Localizations/Japanese.lang | 2 -- Localizations/Korean.lang | 2 -- Localizations/Lolcat.lang | 2 -- Localizations/Polish.lang | 2 -- Localizations/Portuguese.lang | 2 -- Localizations/Russian.lang | 2 -- Localizations/Slovak.lang | 2 -- Localizations/Spanish.lang | 2 -- Localizations/Ukrainian.lang | 2 -- 24 files changed, 30 insertions(+), 75 deletions(-) diff --git a/Libraries/GUI.lua b/Libraries/GUI.lua index f09f0fd5..4113bc65 100755 --- a/Libraries/GUI.lua +++ b/Libraries/GUI.lua @@ -952,6 +952,7 @@ end function GUI.alert(...) local args = {...} + for i = 1, #args do if type(args[i]) == "table" then args[i] = text.serialize(args[i], true) @@ -959,7 +960,10 @@ function GUI.alert(...) args[i] = tostring(args[i]) end end - if #args == 0 then args[1] = "nil" end + + if #args == 0 then + args[1] = "nil" + end local sign = image.fromString([[06030000FF 0000FF 00F7FF▟00F7FF▙0000FF 0000FF 0000FF 00F7FF▟F7FF00 F7FF00 00F7FF▙0000FF 00F7FF▟F7FF00CF7FF00yF7FF00kF7FF00a00F7FF▙]]) local offset = 2 @@ -970,6 +974,7 @@ function GUI.alert(...) lines = text.wrap(lines, textWidth) local height = image.getHeight(sign) + if #lines + 2 > height then height = #lines + 2 end @@ -981,6 +986,7 @@ function GUI.alert(...) workspace:addChild(GUI.panel(1, 1, workspace.width, workspace.height, 0x1D1D1D)) workspace:addChild(GUI.image(x, y, sign)) workspace:addChild(GUI.textBox(x + image.getWidth(sign) + 2, y, textWidth, #lines, 0x1D1D1D, 0xE1E1E1, lines, 1, 0, 0)).eventHandler = nil + local buttonWidth = 10 local button = workspace:addChild(GUI.roundedButton(x + image.getWidth(sign) + textWidth - buttonWidth + 2, workspace.height - offset, buttonWidth, 1, 0x3366CC, 0xE1E1E1, 0xE1E1E1, 0x3366CC, "OK")) diff --git a/Libraries/Screen.lua b/Libraries/Screen.lua index b35483e4..05ae3b5d 100755 --- a/Libraries/Screen.lua +++ b/Libraries/Screen.lua @@ -101,20 +101,15 @@ local function flush(width, height) resetDrawLimit() - local index - for i = 1, bufferWidth * bufferHeight do - index = i - currentFrameBackgrounds[index] = 0x010101 - newFrameBackgrounds[index] = 0x010101 + currentFrameBackgrounds[i] = 0x010101 + newFrameBackgrounds[i] = 0x010101 - index = index + 1 - currentFrameForegrounds[index] = 0xFEFEFE - newFrameForegrounds[index] = 0xFEFEFE + currentFrameForegrounds[i] = 0xFEFEFE + newFrameForegrounds[i] = 0xFEFEFE - index = index + 1 - currentFrameSymbols[index] = " " - newFrameSymbols[index] = " " + currentFrameSymbols[i] = " " + newFrameSymbols[i] = " " end end diff --git a/Libraries/System.lua b/Libraries/System.lua index 94098088..03909f92 100755 --- a/Libraries/System.lua +++ b/Libraries/System.lua @@ -280,6 +280,13 @@ function system.call(method, ...) path, line = path:match("\t+([^:]+%.lua):(%d+):") + -- Weird case on some server machines, unable to reproduce, + -- seems like traceback parsing error + -- TODO: replace this when appropriate error reason will be found + if not path then + return nil + end + return { path = path, line = tonumber(line), @@ -289,6 +296,7 @@ function system.call(method, ...) local xpcallSuccess, xpcallReason = xpcall(launchMethod, tracebackMethod) + -- This shouldn't happen normally, but if so - placeholder error message will be returned if type(xpcallReason) == "string" or xpcallReason == nil then xpcallReason = { path = paths.system.libraries .. "System.lua", @@ -420,7 +428,7 @@ function system.launchWithArguments(path) workspace:draw() end -local iconLaunchers = { +local defaultIconLaunchers = { application = function(icon) system.execute(icon.path .. "Main.lua") end, @@ -837,6 +845,7 @@ local function iconOnRightClick(selectedIcons, icon, e1, e2, e3, e4) end local success, reason = require("Compressor").pack(where .. "/Archive.pkg", itemsToArchive) + if not success then GUI.alert(reason) end @@ -1180,7 +1189,6 @@ local function anyIconFieldUpdateFileList(iconField, func) end end - -- func(list) else GUI.alert("Failed to update file list: " .. tostring(reason)) @@ -1634,6 +1642,7 @@ local function iconFieldBackgroundObjectEventHandler(workspace, object, e1, e2, end if selectedIcon then + selectedIcon.selected = nil selectedIcon:launch() workspace:draw() end @@ -1737,7 +1746,8 @@ local function anyIconFieldAddInfo(iconField, path) -- Duplicate icon launchers for overriding possibility iconField.launchers = {} - for key, value in pairs(iconLaunchers) do + + for key, value in pairs(defaultIconLaunchers) do iconField.launchers[key] = value end end @@ -2190,7 +2200,6 @@ function system.error(path, line, traceback) window:addChild(GUI.panel(1, 1, window.width, 3, 0x3C3C3C)) window:addChild(GUI.label(1, 2, window.width, 1, 0xE1E1E1, localization.errorWhileRunningProgram .. "\"" .. filesystem.name(path) .. "\"")):setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP) local actionButtons = window:addChild(GUI.actionButtons(2, 2, true)) - local sendToDeveloperButton = window:addChild(GUI.adaptiveButton(9, 1, 2, 1, 0x4B4B4B, 0xD2D2D2, 0x2D2D2D, 0xFFFFFF, localization.sendFeedback)) local codeView = window:addChild(GUI.codeView(1, 4, math.floor(window.width * 0.62), window.height - 3, 1, 1, 100, {}, {[line] = 0xFF4444}, GUI.LUA_SYNTAX_PATTERNS, GUI.LUA_SYNTAX_COLOR_SCHEME, true, {})) @@ -2239,23 +2248,10 @@ function system.error(path, line, traceback) end end - sendToDeveloperButton.onTouch = function() - if component.isAvailable("internet") then - local internet = require("Internet") - internet.request("https://api.mcmodder.ru/ECS/report.php?path=" .. internet.encode(path) .. "&errorMessage=" .. internet.encode(traceback)) - - sendToDeveloperButton.text = localization.sendedFeedback - workspace:draw() - event.sleep(1) - end - - actionButtons.close.onTouch() - end - workspace:draw() - for i = 1, 3 do - computer.beep(1500, 0.08) + for i = 1, 2 do + computer.beep(1900, 0.05) end end @@ -2475,7 +2471,7 @@ function system.updateDesktop() dockContainer.updateIcons = function() for i = 1, #dockContainer.children - 1 do - dockContainer.children[i]:analyseExtension(iconLaunchers) + dockContainer.children[i]:analyseExtension(defaultIconLaunchers) end end @@ -2493,7 +2489,7 @@ function system.updateDesktop() path = system.readShortcut(path) end local icon = dockContainer:addChild(system.icon(1, 2, path, dockColors)) - icon:analyseExtension(iconLaunchers) + icon:analyseExtension(defaultIconLaunchers) icon:moveBackward() icon.eventHandler = dockIconEventHandler diff --git a/Localizations/Arabic.lang b/Localizations/Arabic.lang index 3b4152d6..ec5f1b8b 100644 --- a/Localizations/Arabic.lang +++ b/Localizations/Arabic.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "في المجلد الحالي", errorWhileRunningProgram = "خطأ أثناء تشغيل ", - sendedFeedback = "ملاحظات تم إرساله", - sendFeedback = "إرسال ملاحظات", yourContacts = "جهات الاتصال الخاصة بك", additionalInfo = "معلومات إضافية", stackTraceback = "Stack traceback ", diff --git a/Localizations/Belarusian.lang b/Localizations/Belarusian.lang index 109596eb..6b938e54 100644 --- a/Localizations/Belarusian.lang +++ b/Localizations/Belarusian.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "У дзеючай дырэкторыі", errorWhileRunningProgram = "Памылка пры выкананні ", - sendedFeedback = "Справаздача адпраўлена", - sendFeedback = "Адправіць справаздачу", yourContacts = "Вашы кантакты", additionalInfo = "Дадатковая інфармацыя", stackTraceback = "Стэк памылкі", diff --git a/Localizations/Bengali.lang b/Localizations/Bengali.lang index 899eb013..db92ba22 100644 --- a/Localizations/Bengali.lang +++ b/Localizations/Bengali.lang @@ -107,8 +107,6 @@ inCurrentDirectory = "বর্তমান ফোল্ডারে", errorWhileRunningProgram = "চলার সময় ত্রুটি ", - sendedFeedback = "প্রতিক্রিয়া পাঠানো হয়েছিল", - sendFeedback = "প্রতিক্রিয়া পাঠান", yourContacts = "আপনার পরিচিতিগুলি", additionalInfo = "অতিরিক্ত তথ্য", stackTraceback = "স্ট্যাক ট্রেসব্যাক", diff --git a/Localizations/Bulgarian.lang b/Localizations/Bulgarian.lang index b5ff85d4..8c0b090e 100644 --- a/Localizations/Bulgarian.lang +++ b/Localizations/Bulgarian.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "В текущата папка", errorWhileRunningProgram = "Възникна грешка при изпълняване на ", - sendedFeedback = "Обратната връзка бе изпратена", - sendFeedback = "Изпращане на обратна връзка", yourContacts = "Вашите контакти", additionalInfo = "Допълнителна информация", stackTraceback = "Стак на повикванията", diff --git a/Localizations/Chinese.lang b/Localizations/Chinese.lang index 31fe34b8..cbd2cea5 100644 --- a/Localizations/Chinese.lang +++ b/Localizations/Chinese.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "在当前文件夹中", errorWhileRunningProgram = "发生错误,无法执行", - sendedFeedback = "反馈已发送", - sendFeedback = "发送反馈", yourContacts = "联系方式", additionalInfo = "额外信息", stackTraceback = "堆栈跟踪", diff --git a/Localizations/Dutch.lang b/Localizations/Dutch.lang index a9d91712..1301cfca 100644 --- a/Localizations/Dutch.lang +++ b/Localizations/Dutch.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "In huidige map", errorWhileRunningProgram = "Fout tijdens ", - sendedFeedback = "Feedback is verstuurd", - sendFeedback = "Verstuurd feedback", yourContacts = "Jou contacten", additionalInfo = "Extra informatie", stackTraceback = "Stack herleiden", diff --git a/Localizations/English.lang b/Localizations/English.lang index 6b0caefc..68c1256b 100755 --- a/Localizations/English.lang +++ b/Localizations/English.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "In current folder", errorWhileRunningProgram = "Error while running ", - sendedFeedback = "Feedback was sent", - sendFeedback = "Send feedback", yourContacts = "Your contacts", additionalInfo = "Additional information", stackTraceback = "Stack traceback", diff --git a/Localizations/Finnish.lang b/Localizations/Finnish.lang index 560d6bfa..4147f21f 100644 --- a/Localizations/Finnish.lang +++ b/Localizations/Finnish.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "Tämänhetkisessä tiedostossa", errorWhileRunningProgram = "Virhe suorittaessa ", - sendedFeedback = "Palaute lähetetty", - sendFeedback = "Lähetä palautetta", yourContacts = "Yhteystietosi", additionalInfo = "Lisätiedot", stackTraceback = "Pinon jäljitys", diff --git a/Localizations/French.lang b/Localizations/French.lang index 57ff7264..b38f0b66 100644 --- a/Localizations/French.lang +++ b/Localizations/French.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "Dans le répertoire actuel", errorWhileRunningProgram = "Erreur lors de l'exécution ", - sendedFeedback = "Votre commantaire a bien été envoyé", - sendFeedback = "Envoyer un commantaire", yourContacts = "Vos contacts", additionalInfo = "Informations additionnelles", stackTraceback = "Trace d'appels", diff --git a/Localizations/German.lang b/Localizations/German.lang index c38cde38..69cf5b54 100755 --- a/Localizations/German.lang +++ b/Localizations/German.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "Im aktuellen Verzeichnis", errorWhileRunningProgram = "Fehler beim Ausführen", - sendedFeedback = "Fehlerbericht wurde gesendet", - sendFeedback = "Fehlerbericht senden", yourContacts = "Meine Kontakte", additionalInfo = "Zusätzliche Informationen", stackTraceback = "Stacktrace", diff --git a/Localizations/Hindi.lang b/Localizations/Hindi.lang index ea0f9bed..dd2b218c 100644 --- a/Localizations/Hindi.lang +++ b/Localizations/Hindi.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "चालू फ़ोल्डर में", errorWhileRunningProgram = "दौड़ते समय त्रुटि ", - sendedFeedback = "प्रतिक्रिया भेजी गई", - sendFeedback = "फीडबैक", yourContacts = "अपने संपर्क", additionalInfo = "अतिरिक्त जानकारी", stackTraceback = "ढेर ट्रेसबैक", diff --git a/Localizations/Italian.lang b/Localizations/Italian.lang index 7445a4fd..4868c3d8 100755 --- a/Localizations/Italian.lang +++ b/Localizations/Italian.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "Nella directory corrente", errorWhileRunningProgram = "Errore durante l'esecuzione ", - sendedFeedback = "È stato inviato un Feedback", - sendFeedback = "Invia commenti", yourContacts = "I propri contatti", additionalInfo = "Informazioni supplementari", stackTraceback = "Traceback in pila", diff --git a/Localizations/Japanese.lang b/Localizations/Japanese.lang index b587f654..9dbaf14d 100644 --- a/Localizations/Japanese.lang +++ b/Localizations/Japanese.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "現在のフォルダ内", errorWhileRunningProgram = "実行中のエラー ", - sendedFeedback = "フィードバックが送信されました", - sendFeedback = "フィードバックを送る", yourContacts = "あなたの問い合わせ先", additionalInfo = "追加情報", stackTraceback = "スタックトレースバック", diff --git a/Localizations/Korean.lang b/Localizations/Korean.lang index c0f054a6..f032675d 100644 --- a/Localizations/Korean.lang +++ b/Localizations/Korean.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "현재 폴더에", errorWhileRunningProgram = "다음을 실행중 문제가 생겼습니다 : ", - sendedFeedback = "피드백을 보냈습니다.", - sendFeedback = "피드백 보내기", yourContacts = "귀하의 연락처", additionalInfo = "추가 정보", stackTraceback = "문제 정보", diff --git a/Localizations/Lolcat.lang b/Localizations/Lolcat.lang index 8bcd326c..2f8326de 100644 --- a/Localizations/Lolcat.lang +++ b/Localizations/Lolcat.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "In current foldr", errorWhileRunningProgram = "Error whiel runnin ", - sendedFeedback = "Feedback wuz sent", - sendFeedback = "Send feedback", yourContacts = "ur contacts", additionalInfo = "Additional informashun", stackTraceback = "Stack traceback", diff --git a/Localizations/Polish.lang b/Localizations/Polish.lang index 4cf3399f..bfe8fcd1 100644 --- a/Localizations/Polish.lang +++ b/Localizations/Polish.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "W obecnym folderze", errorWhileRunningProgram = "Błąd podczas uruchamiania ", - sendedFeedback = "Wysłano opinię", - sendFeedback = "Wyślij opinię", yourContacts = "Twoje kontakty", additionalInfo = "Dodatkowe informacje", stackTraceback = "Identyfikator", diff --git a/Localizations/Portuguese.lang b/Localizations/Portuguese.lang index b6543841..8013607b 100644 --- a/Localizations/Portuguese.lang +++ b/Localizations/Portuguese.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "Na pasta atua", errorWhileRunningProgram = "Erro ao executar ", - sendedFeedback = "Feedback foi enviado", - sendFeedback = "Enviar feedback", yourContacts = "Seus contatos", additionalInfo = "Informações adicionais", stackTraceback = "Rastreamento de pilha", diff --git a/Localizations/Russian.lang b/Localizations/Russian.lang index 683b601d..ea038832 100755 --- a/Localizations/Russian.lang +++ b/Localizations/Russian.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "В текущей директории", errorWhileRunningProgram = "Ошибка при выполнении ", - sendedFeedback = "Отчет отправлен", - sendFeedback = "Отправить отчет", yourContacts = "Ваши контакты", additionalInfo = "Дополнительная информация", stackTraceback = "Стек ошибки", diff --git a/Localizations/Slovak.lang b/Localizations/Slovak.lang index c44a9b8a..be974470 100644 --- a/Localizations/Slovak.lang +++ b/Localizations/Slovak.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "V tomto priečinku", errorWhileRunningProgram = "Chyba pri behu programu ", - sendedFeedback = "Odozva bola odoslaná", - sendFeedback = "Odoslať odozvu", yourContacts = "Vaše kontakty", additionalInfo = "Ďaľšie informácie", stackTraceback = "Spätné sledovanie zásobníka", diff --git a/Localizations/Spanish.lang b/Localizations/Spanish.lang index 6c3fbf40..2e21ba69 100644 --- a/Localizations/Spanish.lang +++ b/Localizations/Spanish.lang @@ -108,8 +108,6 @@ inCurrentDirectory = "En la Carpeta Actual", errorWhileRunningProgram = "Error al ejecutar ", - sendedFeedback = "La Opinion ha sido Enviada", - sendFeedback = "Enviar Opinion", yourContacts = "Tus Contactos", additionalInfo = "Informacion Adicional", stackTraceback = "Seguimiento de pila", diff --git a/Localizations/Ukrainian.lang b/Localizations/Ukrainian.lang index 2b445952..01086683 100644 --- a/Localizations/Ukrainian.lang +++ b/Localizations/Ukrainian.lang @@ -109,8 +109,6 @@ inCurrentDirectory = "В поточному каталозі", errorWhileRunningProgram = "Помилка під час роботи ", - sendedFeedback = "Звіт відправлений", - sendFeedback = "Відправити звіт", yourContacts = "Ваші контакти", additionalInfo = "Додаткова інформація", stackTraceback = "Стек помилки", From 3f7f0116d7f141e02bbd17bf520ecd3cf4b17176 Mon Sep 17 00:00:00 2001 From: IgorTimofeev Date: Thu, 4 May 2023 18:26:56 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=A1=D0=A3=D0=9A=D0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/Picture Edit.app/Localizations/Ukrainian.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Applications/Picture Edit.app/Localizations/Ukrainian.lang b/Applications/Picture Edit.app/Localizations/Ukrainian.lang index fc73de76..c53b31c9 100644 --- a/Applications/Picture Edit.app/Localizations/Ukrainian.lang +++ b/Applications/Picture Edit.app/Localizations/Ukrainian.lang @@ -24,7 +24,7 @@ hotkeys = "Гарячі клавіші", hotkeysText = { "Є кілька гарячих клавіш, які працюють так само, як у справжньому Photoshop:", - null, + " ", "М та Alt - вибір області", "V - переміщення", "C - масштабування", @@ -33,7 +33,7 @@ "Т – текст", "G – заповнення", "F - інструмент Брайля", - null, + " ", "X - перемикання кольорів", "D - скидання кольорів малюнка", },