This commit is contained in:
Igor Timofeev 2019-01-24 11:30:12 +03:00
parent c8352db0e3
commit c9d8a1d555
31 changed files with 486 additions and 444 deletions

View File

@ -12,6 +12,9 @@ local args, options = system.parseArguments(...)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
local userSettings = system.getUserSettings()
local localization = system.getSystemLocalization()
local configPath = paths.user.applicationData .. "Finder/Config.cfg" local configPath = paths.user.applicationData .. "Finder/Config.cfg"
local config = { local config = {
favourites = { favourites = {
@ -68,7 +71,7 @@ itemsLayout:setAlignment(1, 1, GUI.ALIGNMENT_HORIZONTAL_LEFT, GUI.ALIGNMENT_VERT
itemsLayout:setSpacing(1, 1, 0) itemsLayout:setSpacing(1, 1, 0)
itemsLayout:setMargin(1, 1, 0, 0) itemsLayout:setMargin(1, 1, 0, 0)
local searchInput = window:addChild(GUI.input(1, 2, 20, 1, 0x4B4B4B, 0xC3C3C3, 0x878787, 0x4B4B4B, 0xE1E1E1, nil, system.localization.search, true)) local searchInput = window:addChild(GUI.input(1, 2, 20, 1, 0x4B4B4B, 0xC3C3C3, 0x878787, 0x4B4B4B, 0xE1E1E1, nil, localization.search, true))
local iconField = window:addChild(system.iconField(1, 4, 1, 1, 2, 2, 0x3C3C3C, 0x969696, paths.user.desktop)) local iconField = window:addChild(system.iconField(1, 4, 1, 1, 2, 2, 0x3C3C3C, 0x969696, paths.user.desktop))
@ -209,7 +212,7 @@ updateSidebar = function()
itemsLayout:removeChildren() itemsLayout:removeChildren()
-- Favourites -- Favourites
addSidebarTitle(system.localization.favourite) addSidebarTitle(localization.favourite)
for i = 1, #config.favourites do for i = 1, #config.favourites do
local object = addSidebarItem(" " .. filesystem.name(config.favourites[i].name), config.favourites[i].path) local object = addSidebarItem(" " .. filesystem.name(config.favourites[i].name), config.favourites[i].path)
@ -233,7 +236,7 @@ updateSidebar = function()
for proxy, path in filesystem.mounts() do for proxy, path in filesystem.mounts() do
if proxy.networkModem then if proxy.networkModem then
if not added then if not added then
addSidebarTitle(system.localization.network) addSidebarTitle(localization.network)
added = true added = true
end end
@ -249,11 +252,11 @@ updateSidebar = function()
end end
-- FTP connections -- FTP connections
if network.internetProxy and #system.properties.networkFTPConnections > 0 then if network.internetProxy and #userSettings.networkFTPConnections > 0 then
addSidebarTitle(system.localization.networkFTPConnections) addSidebarTitle(localization.networkFTPConnections)
for i = 1, #system.properties.networkFTPConnections do for i = 1, #userSettings.networkFTPConnections do
local connection = system.properties.networkFTPConnections[i] local connection = userSettings.networkFTPConnections[i]
local name = network.getFTPProxyName(connection.address, connection.port, connection.user) local name = network.getFTPProxyName(connection.address, connection.port, connection.user)
local mountPath = network.mountPaths.FTP .. name .. "/" local mountPath = network.mountPaths.FTP .. name .. "/"
@ -264,10 +267,10 @@ updateSidebar = function()
end end
object.onRemove = function() object.onRemove = function()
table.remove(system.properties.networkFTPConnections, i) table.remove(userSettings.networkFTPConnections, i)
updateSidebar() updateSidebar()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
end end
@ -275,7 +278,7 @@ updateSidebar = function()
end end
-- Mounts -- Mounts
addSidebarTitle(system.localization.mounts) addSidebarTitle(localization.mounts)
for proxy, path in filesystem.mounts() do for proxy, path in filesystem.mounts() do
if not proxy.networkModem and not proxy.networkFTP then if not proxy.networkModem and not proxy.networkFTP then
@ -318,7 +321,7 @@ local function updateScrollBar()
local shownFilesCount = #iconField.fileList - iconField.fromFile + 1 local shownFilesCount = #iconField.fileList - iconField.fromFile + 1
local horizontalLines = math.ceil(shownFilesCount / iconField.iconCount.horizontal) local horizontalLines = math.ceil(shownFilesCount / iconField.iconCount.horizontal)
local minimumOffset = 3 - (horizontalLines - 1) * (system.properties.iconHeight + system.properties.iconVerticalSpace) - system.properties.iconVerticalSpace local minimumOffset = 3 - (horizontalLines - 1) * (userSettings.iconHeight + userSettings.iconVerticalSpace) - userSettings.iconVerticalSpace
if iconField.yOffset > iconFieldYOffset then if iconField.yOffset > iconFieldYOffset then
iconField.yOffset = iconFieldYOffset iconField.yOffset = iconFieldYOffset
@ -352,30 +355,30 @@ prevButton.onTouch = function()
end end
FTPButton.onTouch = function() FTPButton.onTouch = function()
local container = GUI.addBackgroundContainer(workspace, true, true, system.localization.networkFTPNewConnection) local container = GUI.addBackgroundContainer(workspace, true, true, localization.networkFTPNewConnection)
local ad, po, us, pa local ad, po, us, pa
if #system.properties.networkFTPConnections > 0 then if #userSettings.networkFTPConnections > 0 then
local la = system.properties.networkFTPConnections[#system.properties.networkFTPConnections] local la = userSettings.networkFTPConnections[#userSettings.networkFTPConnections]
ad, po, us, pa = la.address, tostring(la.port), la.user, la.password ad, po, us, pa = la.address, tostring(la.port), la.user, la.password
end end
local addressInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, ad, system.localization.networkFTPAddress, true)) local addressInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, ad, localization.networkFTPAddress, true))
local portInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, po, system.localization.networkFTPPort, true)) local portInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, po, localization.networkFTPPort, true))
local userInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, us, system.localization.networkFTPUser, true)) local userInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, us, localization.networkFTPUser, true))
local passwordInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, pa, system.localization.networkFTPPassword, true, "*")) local passwordInput = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, pa, localization.networkFTPPassword, true, "*"))
container.layout:addChild(GUI.button(1, 1, 36, 3, 0x5A5A5A, 0xE1E1E1, 0x2D2D2D, 0xE1E1E1, "OK")).onTouch = function() container.layout:addChild(GUI.button(1, 1, 36, 3, 0x5A5A5A, 0xE1E1E1, 0x2D2D2D, 0xE1E1E1, "OK")).onTouch = function()
container:remove() container:remove()
local port = tonumber(portInput.text) local port = tonumber(portInput.text)
if port then if port then
local found = false local found = false
for i = 1, #system.properties.networkFTPConnections do for i = 1, #userSettings.networkFTPConnections do
if if
system.properties.networkFTPConnections[i].address == addressInput.text and userSettings.networkFTPConnections[i].address == addressInput.text and
system.properties.networkFTPConnections[i].port == port and userSettings.networkFTPConnections[i].port == port and
system.properties.networkFTPConnections[i].user == userInput.text and userSettings.networkFTPConnections[i].user == userInput.text and
system.properties.networkFTPConnections[i].password == passwordInput.text userSettings.networkFTPConnections[i].password == passwordInput.text
then then
found = true found = true
break break
@ -383,13 +386,13 @@ FTPButton.onTouch = function()
end end
if not found then if not found then
table.insert(system.properties.networkFTPConnections, { table.insert(userSettings.networkFTPConnections, {
address = addressInput.text, address = addressInput.text,
port = port, port = port,
user = userInput.text, user = userInput.text,
password = passwordInput.text password = passwordInput.text
}) })
system.saveProperties() system.saveUserSettings()
updateSidebar() updateSidebar()
workspace:draw() workspace:draw()

View File

@ -55,7 +55,7 @@
saveAs = "Save as", saveAs = "Save as",
colorScheme = "Color scheme", colorScheme = "Color scheme",
color = "Color", color = "Color",
toggleTopToolBar = "Show top toolbar", toggleTopToolBar = "Toggle top toolbar",
find = "Find", find = "Find",
findSomeShit = "Let's find some shit…", findSomeShit = "Let's find some shit…",
cut = "Cut", cut = "Cut",
@ -66,4 +66,6 @@
comment = "Toggle comment", comment = "Toggle comment",
indent = "Indent", indent = "Indent",
unindent = "Unindent", unindent = "Unindent",
flashEEPROM = "Flash to EEPROM",
flashingEEPROM = "Flashing in progress. Don't turn off computer...",
} }

View File

@ -55,7 +55,7 @@
saveAs = "Enregistrer sous", saveAs = "Enregistrer sous",
colorScheme = "Schéma de couleurs", colorScheme = "Schéma de couleurs",
color = "Coleur", color = "Coleur",
toggleTopToolBar = "Afficher la barre d'outils supérieure", toggleTopToolBar = "Toggle la barre d'outils supérieure",
find = "Rechercher", find = "Rechercher",
findSomeShit = "Trouvons de la merde ...", findSomeShit = "Trouvons de la merde ...",
cut = "Couper", cut = "Couper",
@ -66,4 +66,6 @@
comment = "Activer les commentaires", comment = "Activer les commentaires",
indent = "Tabulation", indent = "Tabulation",
unindent = "Retirer la tabulation", unindent = "Retirer la tabulation",
flashEEPROM = "Flasher vers l'EEPROM",
flashingEEPROM = "Flash en cours. Ne pas éteindre l'ordinateur...",
} }

View File

@ -55,7 +55,7 @@
saveAs = "Speichern unter", saveAs = "Speichern unter",
colorScheme = "Farbschema", colorScheme = "Farbschema",
color = "Farbig", color = "Farbig",
toggleTopToolBar = "Obere Symbolleiste anzeigen", toggleTopToolBar = "Toggle Symbolleiste anzeigen",
find = "Finden", find = "Finden",
findSomeShit = "Lass uns etwas Scheiße finden…", findSomeShit = "Lass uns etwas Scheiße finden…",
cut = "Schneiden", cut = "Schneiden",
@ -66,4 +66,6 @@
comment = "Kommentar Umschalten", comment = "Kommentar Umschalten",
indent = "Einzug", indent = "Einzug",
unindent = "Unindent", unindent = "Unindent",
flashEEPROM = "Flash zu EEPROM",
flashingEEPROM = "Blinkt im Gange. Computer nicht ausschalten...",
} }

View File

@ -55,7 +55,7 @@
saveAs = "Salva come", saveAs = "Salva come",
colorScheme = "Schema colore", colorScheme = "Schema colore",
color = "Colore", color = "Colore",
toggleTopToolBar = "Mostra barra degli strumenti in alto", toggleTopToolBar = "Toggle barra degli strumenti in alto",
find = "Trovare", find = "Trovare",
findSomeShit = "Troviamo un po ' di roba.…", findSomeShit = "Troviamo un po ' di roba.…",
cut = "Tagliare", cut = "Tagliare",
@ -66,4 +66,6 @@
comment = "Commuta commento", comment = "Commuta commento",
indent = "Indent", indent = "Indent",
unindent = "Unindent", unindent = "Unindent",
flashEEPROM = "Flash su EEPROM",
flashingEEPROM = "Lampeggiante in corso. Non spegnere il computer...",
} }

View File

@ -55,7 +55,7 @@
saveAs = "Сохранить как", saveAs = "Сохранить как",
colorScheme = "Цветовая схема", colorScheme = "Цветовая схема",
color = "Цвет", color = "Цвет",
toggleTopToolBar = "Показать панель инстурментов", toggleTopToolBar = "Переключить панель инстурментов",
find = "Найти", find = "Найти",
findSomeShit = "Давай найдем какую-нибудь хуйню…", findSomeShit = "Давай найдем какую-нибудь хуйню…",
cut = "Вырезать", cut = "Вырезать",
@ -66,4 +66,6 @@
comment = "Комментировать", comment = "Комментировать",
indent = "Табулировать", indent = "Табулировать",
unindent = "Детабулировать", unindent = "Детабулировать",
flashEEPROM = "Записать на EEPROM",
flashingEEPROM = "Идет запись на EEPROM. Не отключайте компьютер...",
} }

View File

@ -54,7 +54,7 @@
saveAs = "Зберегти як", saveAs = "Зберегти як",
colorScheme = "Схема кольорів", colorScheme = "Схема кольорів",
color = "Колір", color = "Колір",
toggleTopToolBar = "Показати панель Інстурмент", toggleTopToolBar = "Переключити панель Інстурмент",
find = "Знайти", find = "Знайти",
findSomeShit = "Давай знайдемо якесь лайно ...", findSomeShit = "Давай знайдемо якесь лайно ...",
cut = "Вирізати", cut = "Вирізати",
@ -65,4 +65,6 @@
comment = "Коментувати", comment = "Коментувати",
indent = "Табулювати", indent = "Табулювати",
unindent = "Детабулювати", unindent = "Детабулювати",
flashEEPROM = "Спалах до EEPROM",
flashingEEPROM = "Блимає в процесі. Не вимикати комп'ютер...",
} }

View File

@ -1643,12 +1643,12 @@ fileContextMenu:addItem(localization.saveAs, false, "^⇧S").onTouch = function(
saveFileAsWindow() saveFileAsWindow()
end end
fileContextMenu:addItem(system.localization.flashEEPROM, not component.isAvailable("eeprom")).onTouch = function() fileContextMenu:addItem(localization.flashEEPROM, not component.isAvailable("eeprom")).onTouch = function()
local container = addBackgroundContainer(system.localization.flashEEPROM) local container = addBackgroundContainer(localization.flashEEPROM)
container.layout:addChild(GUI.label(1, 1, container.width, 1, 0x969696, system.localization.flashingEEPROM .. "...")):setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP) container.layout:addChild(GUI.label(1, 1, container.width, 1, 0x969696, localization.flashingEEPROM .. "...")):setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP)
workspace:draw() workspace:draw()
pcall(component.get("eeprom").set, table.concat(lines, ";")) component.get("eeprom").set(table.concat(lines, "\n"))
container:remove() container:remove()
workspace:draw() workspace:draw()
@ -1747,11 +1747,9 @@ propertiesContextMenu:addItem(localization.cursorProperties).onTouch = function(
workspace:draw() workspace:draw()
end end
if topToolBar.hidden then
propertiesContextMenu:addItem(localization.toggleTopToolBar).onTouch = function() propertiesContextMenu:addItem(localization.toggleTopToolBar).onTouch = function()
toggleTopToolBar() toggleTopToolBar()
end end
end
propertiesContextMenu:addSeparator() propertiesContextMenu:addSeparator()

View File

@ -198,7 +198,7 @@ local function createWindow()
y = y + 2 y = y + 2
workspace.shadeContainer:addChild(GUI.label(3, y, workspace.shadeContainer.width, 1, 0xCCCCCC, "Image path:")) workspace.shadeContainer:addChild(GUI.label(3, y, workspace.shadeContainer.width, 1, 0xCCCCCC, "Image path:"))
local filesystemChooser = workspace.shadeContainer:addChild(GUI.filesystemChooser(workspace.shadeContainer.width - textBoxesWidth - 1, y, textBoxesWidth, 1, 0xEEEEEE, 0x262626, 0x444444, 0x999999, startImagePath, system.localization.open, system.localization.cancel, "Image path", "/")) local filesystemChooser = workspace.shadeContainer:addChild(GUI.filesystemChooser(workspace.shadeContainer.width - textBoxesWidth - 1, y, textBoxesWidth, 1, 0xEEEEEE, 0x262626, 0x444444, 0x999999, startImagePath, "Open", "Cancel", "Image path", "/"))
filesystemChooser:addExtensionFilter(".pic") filesystemChooser:addExtensionFilter(".pic")
filesystemChooser.onSubmit = function(path) filesystemChooser.onSubmit = function(path)
mainImage = image.load(path) mainImage = image.load(path)

View File

@ -7,6 +7,7 @@ local system = require("System")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -28,7 +29,7 @@ module.onTouch = function()
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
end end
@ -37,14 +38,14 @@ module.onTouch = function()
local resolutionComboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5)) local resolutionComboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5))
local function setResolution(width, height) local function setResolution(width, height)
system.properties.interfaceScreenWidth = width userSettings.interfaceScreenWidth = width
system.properties.interfaceScreenHeight = height userSettings.interfaceScreenHeight = height
system.updateResolution() system.updateResolution()
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
local step = 1 / 6 local step = 1 / 6
@ -66,13 +67,13 @@ module.onTouch = function()
local limit = maxWidth * maxHeight local limit = maxWidth * maxHeight
local cykaTextBox = window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x880000, {string.format(localization.screenInvalidResolution, limit)}, 1, 0, 0, true, true)) local cykaTextBox = window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x880000, {string.format(localization.screenInvalidResolution, limit)}, 1, 0, 0, true, true))
local switch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.screenAutoScale .. ":", system.properties.interfaceScreenAutoScale)).switch local switch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.screenAutoScale .. ":", userSettings.interfaceScreenAutoScale)).switch
window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.screenScaleInfo}, 1, 0, 0, true, true)) window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.screenScaleInfo}, 1, 0, 0, true, true))
local function updateSwitch() local function updateSwitch()
widthInput.text = tostring(system.properties.interfaceScreenWidth and system.properties.interfaceScreenWidth or screen.getWidth()) widthInput.text = tostring(userSettings.interfaceScreenWidth and userSettings.interfaceScreenWidth or screen.getWidth())
heightInput.text = tostring(system.properties.interfaceScreenHeight and system.properties.interfaceScreenHeight or screen.getHeight()) heightInput.text = tostring(userSettings.interfaceScreenHeight and userSettings.interfaceScreenHeight or screen.getHeight())
resolutionComboBox.hidden = not switch.state resolutionComboBox.hidden = not switch.state
layout.hidden = switch.state layout.hidden = switch.state
end end
@ -88,8 +89,8 @@ module.onTouch = function()
updateCykaTextBox() updateCykaTextBox()
workspace:draw() workspace:draw()
system.properties.interfaceScreenAutoScale = switch.state userSettings.interfaceScreenAutoScale = switch.state
system.saveProperties() system.saveUserSettings()
end end
widthInput.onInputFinished = function() widthInput.onInputFinished = function()

View File

@ -5,6 +5,7 @@ local system = require("System")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -13,68 +14,68 @@ module.margin = 5
module.onTouch = function() module.onTouch = function()
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.wallpaperWallpaper)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.wallpaperWallpaper))
local wallpaperChooser = window.contentLayout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5, system.properties.interfaceWallpaperPath, localization.open, localization.cancel, localization.wallpaperPath, "/")) local wallpaperChooser = window.contentLayout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5, userSettings.interfaceWallpaperPath, localization.open, localization.cancel, localization.wallpaperPath, "/"))
wallpaperChooser:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE) wallpaperChooser:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
wallpaperChooser:addExtensionFilter(".pic") wallpaperChooser:addExtensionFilter(".pic")
wallpaperChooser.onSubmit = function(path) wallpaperChooser.onSubmit = function(path)
system.properties.interfaceWallpaperPath = path userSettings.interfaceWallpaperPath = path
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
local comboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5)) local comboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5))
comboBox.selectedItem = system.properties.interfaceWallpaperMode or 1 comboBox.selectedItem = userSettings.interfaceWallpaperMode or 1
comboBox:addItem(localization.wallpaperStretch) comboBox:addItem(localization.wallpaperStretch)
comboBox:addItem(localization.wallpaperCenter) comboBox:addItem(localization.wallpaperCenter)
local wallpaperSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.wallpaperEnabled .. ":", system.properties.interfaceWallpaperEnabled)).switch local wallpaperSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.wallpaperEnabled .. ":", userSettings.interfaceWallpaperEnabled)).switch
wallpaperSwitch.onStateChanged = function() wallpaperSwitch.onStateChanged = function()
system.properties.interfaceWallpaperEnabled = wallpaperSwitch.state userSettings.interfaceWallpaperEnabled = wallpaperSwitch.state
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.wallpaperInfo}, 1, 0, 0, true, true)) window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.wallpaperInfo}, 1, 0, 0, true, true))
local wallpaperSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 100, system.properties.interfaceWallpaperBrightness * 100, false, localization.wallpaperBrightness .. ": ", "%")) local wallpaperSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 100, userSettings.interfaceWallpaperBrightness * 100, false, localization.wallpaperBrightness .. ": ", "%"))
wallpaperSlider.height = 2 wallpaperSlider.height = 2
wallpaperSlider.roundValues = true wallpaperSlider.roundValues = true
wallpaperSlider.onValueChanged = function() wallpaperSlider.onValueChanged = function()
system.properties.interfaceWallpaperBrightness = wallpaperSlider.value / 100 userSettings.interfaceWallpaperBrightness = wallpaperSlider.value / 100
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
comboBox.onItemSelected = function() comboBox.onItemSelected = function()
system.properties.interfaceWallpaperMode = comboBox.selectedItem userSettings.interfaceWallpaperMode = comboBox.selectedItem
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.wallpaperScreensaver)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.wallpaperScreensaver))
local screensaverChooser = window.contentLayout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5, system.properties.interfaceScreensaverPath, localization.open, localization.cancel, localization.wallpaperScreensaverPath, "/")) local screensaverChooser = window.contentLayout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5, userSettings.interfaceScreensaverPath, localization.open, localization.cancel, localization.wallpaperScreensaverPath, "/"))
screensaverChooser:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE) screensaverChooser:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
screensaverChooser:addExtensionFilter(".lua") screensaverChooser:addExtensionFilter(".lua")
local screensaverSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.wallpaperScreensaverEnabled .. ":", system.properties.interfaceScreensaverEnabled)).switch local screensaverSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.wallpaperScreensaverEnabled .. ":", userSettings.interfaceScreensaverEnabled)).switch
local screensaverSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 1, 100, system.properties.interfaceScreensaverDelay, false, localization.wallpaperScreensaverDelay .. ": ", " s")) local screensaverSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 1, 100, userSettings.interfaceScreensaverDelay, false, localization.wallpaperScreensaverDelay .. ": ", " s"))
local function save() local function save()
system.properties.interfaceScreensaverEnabled = screensaverSwitch.state userSettings.interfaceScreensaverEnabled = screensaverSwitch.state
system.properties.interfaceScreensaverPath = screensaverChooser.path userSettings.interfaceScreensaverPath = screensaverChooser.path
system.properties.interfaceScreensaverDelay = screensaverSlider.value userSettings.interfaceScreensaverDelay = screensaverSlider.value
system.saveProperties() system.saveUserSettings()
end end
screensaverChooser.onSubmit, screensaverSwitch.onStateChanged, screensaverSlider.onValueChanged = save, save, save screensaverChooser.onSubmit, screensaverSwitch.onStateChanged, screensaverSlider.onValueChanged = save, save, save

View File

@ -6,6 +6,7 @@ local system = require("System")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -14,28 +15,28 @@ module.margin = 12
module.onTouch = function() module.onTouch = function()
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceFiles)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceFiles))
local showExtensionSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceExtensions .. ":", system.properties.filesShowExtension)).switch local showExtensionSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceExtensions .. ":", userSettings.filesShowExtension)).switch
local showHiddenFilesSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceHidden .. ":", system.properties.filesShowHidden)).switch local showHiddenFilesSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceHidden .. ":", userSettings.filesShowHidden)).switch
local showApplicationIconsSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceApplications .. ":", system.properties.filesShowApplicationIcon)).switch local showApplicationIconsSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceApplications .. ":", userSettings.filesShowApplicationIcon)).switch
local transparencySwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceTransparencyEnabled .. ":", system.properties.interfaceTransparencyEnabled)).switch local transparencySwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceTransparencyEnabled .. ":", userSettings.interfaceTransparencyEnabled)).switch
window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.appearanceTransparencyInfo}, 1, 0, 0, true, true)) window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.appearanceTransparencyInfo}, 1, 0, 0, true, true))
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceColorScheme)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceColorScheme))
local backgroundColorSelector = window.contentLayout:addChild(GUI.colorSelector(1, 1, 36, 3, system.properties.interfaceColorDesktopBackground, localization.appearanceDesktopBackground)) local backgroundColorSelector = window.contentLayout:addChild(GUI.colorSelector(1, 1, 36, 3, userSettings.interfaceColorDesktopBackground, localization.appearanceDesktopBackground))
local menuColorSelector = window.contentLayout:addChild(GUI.colorSelector(1, 1, 36, 3, system.properties.interfaceColorMenu, localization.appearanceMenu)) local menuColorSelector = window.contentLayout:addChild(GUI.colorSelector(1, 1, 36, 3, userSettings.interfaceColorMenu, localization.appearanceMenu))
local dockColorSelector = window.contentLayout:addChild(GUI.colorSelector(1, 1, 36, 3, system.properties.interfaceColorDock, localization.appearanceDock)) local dockColorSelector = window.contentLayout:addChild(GUI.colorSelector(1, 1, 36, 3, userSettings.interfaceColorDock, localization.appearanceDock))
backgroundColorSelector.onColorSelected = function() backgroundColorSelector.onColorSelected = function()
system.properties.interfaceColorDesktopBackground = backgroundColorSelector.color userSettings.interfaceColorDesktopBackground = backgroundColorSelector.color
system.properties.interfaceColorMenu = menuColorSelector.color userSettings.interfaceColorMenu = menuColorSelector.color
system.properties.interfaceColorDock = dockColorSelector.color userSettings.interfaceColorDock = dockColorSelector.color
system.properties.interfaceTransparencyEnabled = transparencySwitch.state userSettings.interfaceTransparencyEnabled = transparencySwitch.state
system.updateColorScheme() system.updateColorScheme()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
menuColorSelector.onColorSelected = backgroundColorSelector.onColorSelected menuColorSelector.onColorSelected = backgroundColorSelector.onColorSelected
dockColorSelector.onColorSelected = backgroundColorSelector.onColorSelected dockColorSelector.onColorSelected = backgroundColorSelector.onColorSelected
@ -43,42 +44,42 @@ module.onTouch = function()
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceSize)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceSize))
local iconWidthSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 8, 16, system.properties.iconWidth, false, localization.appearanceHorizontal .. ": ", "")) local iconWidthSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 8, 16, userSettings.iconWidth, false, localization.appearanceHorizontal .. ": ", ""))
local iconHeightSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 6, 16, system.properties.iconHeight, false, localization.appearanceVertical .. ": ", "")) local iconHeightSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 6, 16, userSettings.iconHeight, false, localization.appearanceVertical .. ": ", ""))
iconHeightSlider.height = 2 iconHeightSlider.height = 2
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceSpace)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.appearanceSpace))
local iconHorizontalSpaceBetweenSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 5, system.properties.iconHorizontalSpace, false, localization.appearanceHorizontal .. ": ", "")) local iconHorizontalSpaceBetweenSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 5, userSettings.iconHorizontalSpace, false, localization.appearanceHorizontal .. ": ", ""))
local iconVerticalSpaceBetweenSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 5, system.properties.iconVerticalSpace, false, localization.appearanceVertical .. ": ", "")) local iconVerticalSpaceBetweenSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 5, userSettings.iconVerticalSpace, false, localization.appearanceVertical .. ": ", ""))
iconVerticalSpaceBetweenSlider.height = 2 iconVerticalSpaceBetweenSlider.height = 2
iconHorizontalSpaceBetweenSlider.roundValues, iconVerticalSpaceBetweenSlider.roundValues = true, true iconHorizontalSpaceBetweenSlider.roundValues, iconVerticalSpaceBetweenSlider.roundValues = true, true
iconWidthSlider.roundValues, iconHeightSlider.roundValues = true, true iconWidthSlider.roundValues, iconHeightSlider.roundValues = true, true
local function setIconProperties(width, height, horizontalSpace, verticalSpace) local function setIconProperties(width, height, horizontalSpace, verticalSpace)
system.properties.iconWidth, system.properties.iconHeight, system.properties.iconHorizontalSpace, system.properties.iconVerticalSpace = width, height, horizontalSpace, verticalSpace userSettings.iconWidth, userSettings.iconHeight, userSettings.iconHorizontalSpace, userSettings.iconVerticalSpace = width, height, horizontalSpace, verticalSpace
system.saveProperties() system.saveUserSettings()
system.calculateIconProperties() system.calculateIconProperties()
system.updateIconProperties() system.updateIconProperties()
end end
iconWidthSlider.onValueChanged = function() iconWidthSlider.onValueChanged = function()
setIconProperties(math.floor(iconWidthSlider.value), math.floor(iconHeightSlider.value), system.properties.iconHorizontalSpace, system.properties.iconVerticalSpace) setIconProperties(math.floor(iconWidthSlider.value), math.floor(iconHeightSlider.value), userSettings.iconHorizontalSpace, userSettings.iconVerticalSpace)
end end
iconHeightSlider.onValueChanged = iconWidthSlider.onValueChanged iconHeightSlider.onValueChanged = iconWidthSlider.onValueChanged
iconHorizontalSpaceBetweenSlider.onValueChanged = function() iconHorizontalSpaceBetweenSlider.onValueChanged = function()
setIconProperties(system.properties.iconWidth, system.properties.iconHeight, math.floor(iconHorizontalSpaceBetweenSlider.value), math.floor(iconVerticalSpaceBetweenSlider.value)) setIconProperties(userSettings.iconWidth, userSettings.iconHeight, math.floor(iconHorizontalSpaceBetweenSlider.value), math.floor(iconVerticalSpaceBetweenSlider.value))
end end
iconVerticalSpaceBetweenSlider.onValueChanged = iconHorizontalSpaceBetweenSlider.onValueChanged iconVerticalSpaceBetweenSlider.onValueChanged = iconHorizontalSpaceBetweenSlider.onValueChanged
showExtensionSwitch.onStateChanged = function() showExtensionSwitch.onStateChanged = function()
system.properties.filesShowExtension = showExtensionSwitch.state userSettings.filesShowExtension = showExtensionSwitch.state
system.properties.filesShowHidden = showHiddenFilesSwitch.state userSettings.filesShowHidden = showHiddenFilesSwitch.state
system.properties.filesShowApplicationIcon = showApplicationIconsSwitch.state userSettings.filesShowApplicationIcon = showApplicationIconsSwitch.state
system.saveProperties() system.saveUserSettings()
computer.pushSignal("system", "updateFileList") computer.pushSignal("system", "updateFileList")
end end

View File

@ -6,6 +6,7 @@ local system = require("System")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -26,21 +27,21 @@ module.onTouch = function()
local switchAndLabel = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.tasksEnabled .. ":", true)) local switchAndLabel = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.tasksEnabled .. ":", true))
local function update() local function update()
switchAndLabel.hidden = #system.properties.tasks == 0 switchAndLabel.hidden = #userSettings.tasks == 0
modeComboBox.hidden = switchAndLabel.hidden modeComboBox.hidden = switchAndLabel.hidden
container.hidden = switchAndLabel.hidden container.hidden = switchAndLabel.hidden
if not switchAndLabel.hidden then if not switchAndLabel.hidden then
modeComboBox.selectedItem = system.properties.tasks[tasksComboBox.selectedItem].mode modeComboBox.selectedItem = userSettings.tasks[tasksComboBox.selectedItem].mode
switchAndLabel.switch:setState(system.properties.tasks[tasksComboBox.selectedItem].enabled) switchAndLabel.switch:setState(userSettings.tasks[tasksComboBox.selectedItem].enabled)
end end
end end
local function fill() local function fill()
tasksComboBox:clear() tasksComboBox:clear()
for i = 1, #system.properties.tasks do for i = 1, #userSettings.tasks do
tasksComboBox:addItem(system.properties.tasks[i].path) tasksComboBox:addItem(userSettings.tasks[i].path)
end end
tasksComboBox.selectedItem = tasksComboBox:count() tasksComboBox.selectedItem = tasksComboBox:count()
@ -50,7 +51,7 @@ module.onTouch = function()
tasksComboBox.onItemSelected = update tasksComboBox.onItemSelected = update
filesystemChooser.onSubmit = function(path) filesystemChooser.onSubmit = function(path)
table.insert(system.properties.tasks, { table.insert(userSettings.tasks, {
path = filesystemChooser.path, path = filesystemChooser.path,
enabled = switchAndLabel.switch.state, enabled = switchAndLabel.switch.state,
mode = modeComboBox.selectedItem, mode = modeComboBox.selectedItem,
@ -59,27 +60,27 @@ module.onTouch = function()
filesystemChooser.path = nil filesystemChooser.path = nil
fill() fill()
system.saveProperties() system.saveUserSettings()
end end
removeButton.onTouch = function() removeButton.onTouch = function()
table.remove(system.properties.tasks, tasksComboBox.selectedItem) table.remove(userSettings.tasks, tasksComboBox.selectedItem)
fill() fill()
system.saveProperties() system.saveUserSettings()
end end
modeComboBox.onItemSelected = function() modeComboBox.onItemSelected = function()
if #system.properties.tasks > 0 then if #userSettings.tasks > 0 then
system.properties.tasks[tasksComboBox.selectedItem].mode = modeComboBox.selectedItem userSettings.tasks[tasksComboBox.selectedItem].mode = modeComboBox.selectedItem
system.saveProperties() system.saveUserSettings()
end end
end end
switchAndLabel.switch.onStateChanged = function() switchAndLabel.switch.onStateChanged = function()
if #system.properties.tasks > 0 then if #userSettings.tasks > 0 then
system.properties.tasks[tasksComboBox.selectedItem].enabled = switchAndLabel.switch.state userSettings.tasks[tasksComboBox.selectedItem].enabled = switchAndLabel.switch.state
system.saveProperties() system.saveUserSettings()
end end
end end

View File

@ -10,6 +10,7 @@ local SHA = require("SHA-256")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -52,7 +53,7 @@ module.onTouch = function()
local passwordText = window.contentLayout:addChild(GUI.text(1, 1, 0xCC4940, localization.usersPasswordsArentEqual)) local passwordText = window.contentLayout:addChild(GUI.text(1, 1, 0xCC4940, localization.usersPasswordsArentEqual))
local function updatePasswordText() local function updatePasswordText()
passwordButton.text = system.properties.securityPassword and localization.usersRemovePassword or localization.usersAddPassword passwordButton.text = userSettings.securityPassword and localization.usersRemovePassword or localization.usersAddPassword
end end
local function updateRename(state) local function updateRename(state)
@ -111,7 +112,7 @@ module.onTouch = function()
addUserButton.onTouch = function() addUserButton.onTouch = function()
local name = "User #" .. math.random(0xFFFFFF) local name = "User #" .. math.random(0xFFFFFF)
system.createUser(name, system.properties.localizationLanguage, nil, true, true) system.createUser(name, userSettings.localizationLanguage, nil, true, true)
usersComboBox:addItem(name) usersComboBox:addItem(name)
usersComboBox.selectedItem = usersComboBox:count() usersComboBox.selectedItem = usersComboBox:count()
end end
@ -130,12 +131,12 @@ module.onTouch = function()
end end
passwordButton.onTouch = function() passwordButton.onTouch = function()
if system.properties.securityPassword then if userSettings.securityPassword then
system.properties.securityPassword = nil userSettings.securityPassword = nil
updatePasswordText() updatePasswordText()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
else else
updateRemoveAndPasswordButtons(true) updateRemoveAndPasswordButtons(true)
end end
@ -161,8 +162,8 @@ module.onTouch = function()
passwordInput.onInputFinished = function() passwordInput.onInputFinished = function()
if #passwordInput.text > 0 and #submitPasswordInput.text > 0 then if #passwordInput.text > 0 and #submitPasswordInput.text > 0 then
if passwordInput.text == submitPasswordInput.text then if passwordInput.text == submitPasswordInput.text then
system.properties.securityPassword = SHA.hash(passwordInput.text) userSettings.securityPassword = SHA.hash(passwordInput.text)
system.saveProperties() system.saveUserSettings()
passwordInput.text = "" passwordInput.text = ""
submitPasswordInput.text = "" submitPasswordInput.text = ""

View File

@ -7,6 +7,7 @@ local filesystem = require("Filesystem")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -8,6 +8,7 @@ local filesystem = require("Filesystem")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -17,13 +18,13 @@ module.onTouch = function()
local emptyObject = window.contentLayout:addChild(GUI.object(1, 1, 0, 0)) local emptyObject = window.contentLayout:addChild(GUI.object(1, 1, 0, 0))
local insertModemText = window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.networkNoModem)) local insertModemText = window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.networkNoModem))
local ebloText = window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.networkThis)) local ebloText = window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.networkThis))
local networkNameInput = window.contentLayout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xA5A5A5, 0xE1E1E1, 0x2D2D2D, system.properties.networkName or "", localization.networkName)) local networkNameInput = window.contentLayout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xA5A5A5, 0xE1E1E1, 0x2D2D2D, userSettings.networkName or "", localization.networkName))
local stateSwitchAndLabel = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.networkEnabled .. ":", system.properties.networkEnabled)) local stateSwitchAndLabel = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.networkEnabled .. ":", userSettings.networkEnabled))
local remoteComputersText = window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.networkRemote)) local remoteComputersText = window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.networkRemote))
local remoteComputersComboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5)) local remoteComputersComboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5))
local allowReadAndWriteSwitchAndLabel = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.networkFileAccess .. ":", false)) local allowReadAndWriteSwitchAndLabel = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.networkFileAccess .. ":", false))
local signalStrengthSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 512, system.properties.networkSignalStrength, false, localization.networkRadius ..": ", "")) local signalStrengthSlider = window.contentLayout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, 0, 512, userSettings.networkSignalStrength, false, localization.networkRadius ..": ", ""))
signalStrengthSlider.roundValues = true signalStrengthSlider.roundValues = true
local function check() local function check()
@ -47,7 +48,7 @@ module.onTouch = function()
local item = remoteComputersComboBox:addItem(network.getModemProxyName(proxy)) local item = remoteComputersComboBox:addItem(network.getModemProxyName(proxy))
item.proxyAddress = proxy.address item.proxyAddress = proxy.address
item.onTouch = function() item.onTouch = function()
allowReadAndWriteSwitchAndLabel.switch:setState(system.properties.networkUsers[item.proxyAddress].allowReadAndWrite) allowReadAndWriteSwitchAndLabel.switch:setState(userSettings.networkUsers[item.proxyAddress].allowReadAndWrite)
end end
end end
end end
@ -66,14 +67,14 @@ module.onTouch = function()
end end
networkNameInput.onInputFinished = function() networkNameInput.onInputFinished = function()
system.properties.networkName = #networkNameInput.text > 0 and networkNameInput.text or nil userSettings.networkName = #networkNameInput.text > 0 and networkNameInput.text or nil
system.saveProperties() system.saveUserSettings()
network.broadcastComputerState(system.properties.networkEnabled) network.broadcastComputerState(userSettings.networkEnabled)
end end
signalStrengthSlider.onValueChanged = function() signalStrengthSlider.onValueChanged = function()
system.properties.networkSignalStrength = math.floor(signalStrengthSlider.value) userSettings.networkSignalStrength = math.floor(signalStrengthSlider.value)
system.saveProperties() system.saveUserSettings()
end end
stateSwitchAndLabel.switch.onStateChanged = function() stateSwitchAndLabel.switch.onStateChanged = function()
@ -87,8 +88,8 @@ module.onTouch = function()
end end
allowReadAndWriteSwitchAndLabel.switch.onStateChanged = function() allowReadAndWriteSwitchAndLabel.switch.onStateChanged = function()
system.properties.networkUsers[remoteComputersComboBox:getItem(remoteComputersComboBox.selectedItem).proxyAddress].allowReadAndWrite = allowReadAndWriteSwitchAndLabel.switch.state userSettings.networkUsers[remoteComputersComboBox:getItem(remoteComputersComboBox.selectedItem).proxyAddress].allowReadAndWrite = allowReadAndWriteSwitchAndLabel.switch.state
system.saveProperties() system.saveUserSettings()
end end
-- Empty object-listener -- Empty object-listener

View File

@ -7,6 +7,7 @@ local filesystem = require("Filesystem")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -22,17 +23,17 @@ module.onTouch = function()
local name = filesystem.hideExtension(list[i]) local name = filesystem.hideExtension(list[i])
comboBox:addItem(name).onTouch = function() comboBox:addItem(name).onTouch = function()
system.properties.localizationLanguage = name userSettings.localizationLanguage = name
system.localization = system.getLocalization(paths.system.localizations) localization = system.getLocalization(paths.system.localizations)
system.updateWorkspace() system.updateWorkspace()
system.updateDesktop() system.updateDesktop()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
if name == system.properties.localizationLanguage then if name == userSettings.localizationLanguage then
comboBox.selectedItem = comboBox:count() comboBox.selectedItem = comboBox:count()
end end
end end

View File

@ -6,6 +6,7 @@ local system = require("System")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -23,22 +24,22 @@ module.onTouch = function()
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.timeFormat)) window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.timeFormat))
local input = window.contentLayout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xA5A5A5, 0xE1E1E1, 0x2D2D2D, system.properties.timeFormat or "")) local input = window.contentLayout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xA5A5A5, 0xE1E1E1, 0x2D2D2D, userSettings.timeFormat or ""))
local switch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.timeUseRealTimestamp .. ":", system.properties.timeRealTimestamp)).switch local switch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.timeUseRealTimestamp .. ":", userSettings.timeRealTimestamp)).switch
window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.timeInfo}, 1, 0, 0, true, true)) window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.timeInfo}, 1, 0, 0, true, true))
comboBox.selectedItem = (system.properties.timeTimezone or 0) + 13 comboBox.selectedItem = (userSettings.timeTimezone or 0) + 13
comboBox.onItemSelected = function() comboBox.onItemSelected = function()
system.properties.timeRealTimestamp = switch.state userSettings.timeRealTimestamp = switch.state
system.properties.timeTimezone = (comboBox.selectedItem - 13) * 3600 userSettings.timeTimezone = (comboBox.selectedItem - 13) * 3600
system.properties.timeFormat = input.text userSettings.timeFormat = input.text
system.updateMenuWidgets() system.updateMenuWidgets()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
input.onInputFinished, switch.onStateChanged = comboBox.onItemSelected, comboBox.onItemSelected input.onInputFinished, switch.onStateChanged = comboBox.onItemSelected, comboBox.onItemSelected

View File

@ -6,6 +6,7 @@ local system = require("System")
local module = {} local module = {}
local workspace, window, localization = table.unpack({...}) local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -55,11 +56,11 @@ module.onTouch = function()
update() update()
end end
local switch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.systemUnloading .. ":", system.properties.packageUnloading)).switch local switch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.systemUnloading .. ":", userSettings.packageUnloading)).switch
switch.onStateChanged = function() switch.onStateChanged = function()
system.properties.packageUnloading = switch.state userSettings.packageUnloading = switch.state
system.setPackageUnloading(system.properties.packageUnloading) system.setPackageUnloading(userSettings.packageUnloading)
system.saveProperties() system.saveUserSettings()
end end
window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.systemInfo}, 1, 0, 0, true, true)) window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.systemInfo}, 1, 0, 0, true, true))

View File

@ -3,11 +3,12 @@ local paths = require("Paths")
local system = require("System") local system = require("System")
local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...) local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...)
local localization = system.getSystemLocalization()
menu:addItem(system.localization.edit).onTouch = function() menu:addItem(localization.edit).onTouch = function()
system.execute(paths.editor, icon.path) system.execute(paths.editor, icon.path)
end end
menu:addItem(system.localization.uploadToPastebin, not component.isAvailable("internet")).onTouch = function() menu:addItem(localization.uploadToPastebin, not component.isAvailable("internet")).onTouch = function()
system.uploadToPastebin(icon.path) system.uploadToPastebin(icon.path)
end end

View File

@ -5,24 +5,25 @@ local paths = require("Paths")
local system = require("System") local system = require("System")
local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...) local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...)
local localization = system.getSystemLocalization()
menu:addItem(system.localization.edit).onTouch = function() menu:addItem(localization.edit).onTouch = function()
system.execute(paths.system.applicationMineCodeIDE, icon.path) system.execute(paths.system.applicationMineCodeIDE, icon.path)
end end
menu:addItem(system.localization.uploadToPastebin, not component.isAvailable("internet")).onTouch = function() menu:addItem(localization.uploadToPastebin, not component.isAvailable("internet")).onTouch = function()
system.uploadToPastebin(icon.path) system.uploadToPastebin(icon.path)
end end
menu:addSeparator() menu:addSeparator()
menu:addItem(system.localization.launchWithArguments).onTouch = function() menu:addItem(localization.launchWithArguments).onTouch = function()
system.launchWithArguments(workspace, icon.path) system.launchWithArguments(workspace, icon.path)
end end
menu:addItem(system.localization.flashEEPROM, not component.isAvailable("eeprom") or filesystem.size(icon.path) > 4096).onTouch = function() menu:addItem(localization.flashEEPROM, not component.isAvailable("eeprom") or filesystem.size(icon.path) > 4096).onTouch = function()
local container = GUI.addBackgroundContainer(workspace, true, true, system.localization.flashEEPROM) local container = GUI.addBackgroundContainer(workspace, true, true, localization.flashEEPROM)
container.layout:addChild(GUI.label(1, 1, container.width, 1, 0x969696, system.localization.flashingEEPROM .. "...")):setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP) container.layout:addChild(GUI.label(1, 1, container.width, 1, 0x969696, localization.flashingEEPROM .. "...")):setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP)
workspace:draw() workspace:draw()
component.get("eeprom").set(filesystem.read(icon.path)) component.get("eeprom").set(filesystem.read(icon.path))

View File

@ -2,17 +2,19 @@
local system = require("System") local system = require("System")
local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...) local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...)
local localization = system.getSystemLocalization()
local userSettings = system.getUserSettings()
menu:addItem(system.localization.setAsWallpaper).onTouch = function() menu:addItem(localization.setAsWallpaper).onTouch = function()
system.properties.interfaceWallpaperEnabled = true userSettings.interfaceWallpaperEnabled = true
system.properties.interfaceWallpaperPath = icon.path userSettings.interfaceWallpaperPath = icon.path
system.updateWallpaper() system.updateWallpaper()
workspace:draw() workspace:draw()
system.saveProperties() system.saveUserSettings()
end end
menu:addItem(system.localization.uploadToPastebin, not component.isAvailable("internet")).onTouch = function() menu:addItem(localization.uploadToPastebin, not component.isAvailable("internet")).onTouch = function()
system.uploadToPastebin(icon.path) system.uploadToPastebin(icon.path)
end end

View File

@ -10,6 +10,7 @@ local network = {}
---------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------
local userSettings
local filesystemProxy = filesystem.getProxy() local filesystemProxy = filesystem.getProxy()
network.filesystemHandles = {} network.filesystemHandles = {}
@ -205,7 +206,7 @@ end
local function check(...) local function check(...)
local result = {...} local result = {...}
if not result[1] then if not result[1] then
GUI.error(table.unpack(result, 2)) GUI.alert(table.unpack(result, 2))
end end
return table.unpack(result) return table.unpack(result)
end end
@ -438,7 +439,7 @@ function network.setSignalStrength(strength)
end end
function network.broadcastComputerState(state) function network.broadcastComputerState(state)
return network.broadcastMessage("network", state and "computerAvailable" or "computerNotAvailable", system.properties.networkName) return network.broadcastMessage("network", state and "computerAvailable" or "computerNotAvailable", userSettings.networkName)
end end
local function newModemProxy(address) local function newModemProxy(address)
@ -601,7 +602,7 @@ end
local exceptionMethods = { local exceptionMethods = {
getLabel = function() getLabel = function()
return system.properties.networkName or network.modemProxy.address return userSettings.networkName or network.modemProxy.address
end, end,
list = function(path) list = function(path)
@ -644,7 +645,7 @@ local exceptionMethods = {
} }
local function handleRequest(eventData) local function handleRequest(eventData)
if system.properties.networkUsers[eventData[3]].allowReadAndWrite then if userSettings.networkUsers[eventData[3]].allowReadAndWrite then
local result = { pcall(exceptionMethods[eventData[8]] or filesystemProxy[eventData[8]], table.unpack(eventData, 9)) } local result = { pcall(exceptionMethods[eventData[8]] or filesystemProxy[eventData[8]], table.unpack(eventData, 9)) }
network.sendMessage(eventData[3], "network", "response", eventData[8], table.unpack(result, result[1] and 2 or 1)) network.sendMessage(eventData[3], "network", "response", eventData[8], table.unpack(result, result[1] and 2 or 1))
else else
@ -655,23 +656,25 @@ end
---------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------
function network.update() function network.update()
userSettings = system.getUserSettings()
network.unmountModems() network.unmountModems()
network.unmountFTPs() network.unmountFTPs()
network.updateComponents() network.updateComponents()
network.setSignalStrength(system.properties.networkSignalStrength) network.setSignalStrength(userSettings.networkSignalStrength)
network.broadcastComputerState(system.properties.networkEnabled) network.broadcastComputerState(userSettings.networkEnabled)
if network.eventHandlerID then if network.eventHandlerID then
event.removeHandler(network.eventHandlerID) event.removeHandler(network.eventHandlerID)
end end
if system.properties.networkEnabled then if userSettings.networkEnabled then
network.eventHandlerID = event.addHandler(function(...) network.eventHandlerID = event.addHandler(function(...)
local eventData = {...} local eventData = {...}
if (eventData[1] == "component_added" or eventData[1] == "component_removed") and (eventData[3] == "modem" or eventData[3] == "internet") then if (eventData[1] == "component_added" or eventData[1] == "component_removed") and (eventData[3] == "modem" or eventData[3] == "internet") then
network.updateComponents() network.updateComponents()
elseif eventData[1] == "modem_message" and system.properties.networkEnabled and eventData[6] == "network" then elseif eventData[1] == "modem_message" and userSettings.networkEnabled and eventData[6] == "network" then
if eventData[7] == "request" then if eventData[7] == "request" then
handleRequest(eventData) handleRequest(eventData)
elseif eventData[7] == "computerAvailable" or eventData[7] == "computerAvailableRedirect" then elseif eventData[7] == "computerAvailable" or eventData[7] == "computerAvailableRedirect" then
@ -686,12 +689,12 @@ function network.update()
filesystem.mount(proxy, paths.system.mounts .. eventData[3] .. "/") filesystem.mount(proxy, paths.system.mounts .. eventData[3] .. "/")
if eventData[7] == "computerAvailable" then if eventData[7] == "computerAvailable" then
network.sendMessage(eventData[3], "network", "computerAvailableRedirect", system.properties.networkName) network.sendMessage(eventData[3], "network", "computerAvailableRedirect", userSettings.networkName)
end end
if not system.properties.networkUsers[eventData[3]] then if not userSettings.networkUsers[eventData[3]] then
system.properties.networkUsers[eventData[3]] = {} userSettings.networkUsers[eventData[3]] = {}
system.saveProperties() system.saveUserSettings()
end end
computer.pushSignal("network", "updateProxyList") computer.pushSignal("network", "updateProxyList")
@ -709,14 +712,14 @@ function network.update()
end end
function network.disable() function network.disable()
system.properties.networkEnabled = false userSettings.networkEnabled = false
system.saveProperties() system.saveUserSettings()
network.update() network.update()
end end
function network.enable() function network.enable()
system.properties.networkEnabled = true userSettings.networkEnabled = true
system.saveProperties() system.saveUserSettings()
network.update() network.update()
end end

View File

@ -43,7 +43,7 @@ function paths.getUser(name)
user.screensavers = user.home .. "Screensavers/" user.screensavers = user.home .. "Screensavers/"
user.trash = user.home .. "Trash/" user.trash = user.home .. "Trash/"
user.versions = user.home .. "Versions.cfg" user.versions = user.home .. "Versions.cfg"
user.properties = user.home .. "Properties.cfg" user.settings = user.home .. "Settings.cfg"
return user return user
end end

File diff suppressed because it is too large Load Diff

View File

@ -83,7 +83,7 @@
showPackageContent = "Show package content", showPackageContent = "Show package content",
showContainingFolder = "Show containing folder", showContainingFolder = "Show containing folder",
flashEEPROM = "Flash to EEPROM", flashEEPROM = "Flash to EEPROM",
flashingEEPROM = "Flashing in progress. Don't turn off computer", flashingEEPROM = "Flashing in progress. Don't turn off computer...",
sortBy = "Sort", sortBy = "Sort",
sortByType = "By type", sortByType = "By type",

View File

@ -83,7 +83,7 @@
showPackageContent = "Afficher le contenu du package", showPackageContent = "Afficher le contenu du package",
showContainingFolder = "Afficher le dossier contenant", showContainingFolder = "Afficher le dossier contenant",
flashEEPROM = "Flasher vers l'EEPROM", flashEEPROM = "Flasher vers l'EEPROM",
flashingEEPROM = "Flash en cours. Ne pas éteindre l'ordinateur", flashingEEPROM = "Flash en cours. Ne pas éteindre l'ordinateur...",
sortBy = "Trier", sortBy = "Trier",
sortByType = "Par type", sortByType = "Par type",

View File

@ -83,7 +83,7 @@
showPackageContent = "Paketinhalt anzeigen", showPackageContent = "Paketinhalt anzeigen",
showContainingFolder = "Enthaltenden Ordner anzeigen", showContainingFolder = "Enthaltenden Ordner anzeigen",
flashEEPROM = "Flash zu EEPROM", flashEEPROM = "Flash zu EEPROM",
flashingEEPROM = "Blinkt im Gange. Computer nicht ausschalten", flashingEEPROM = "Blinkt im Gange. Computer nicht ausschalten...",
sortBy = "Sortieren", sortBy = "Sortieren",
sortByType = "Nach Typ", sortByType = "Nach Typ",

View File

@ -83,7 +83,7 @@
showPackageContent = "Mostra il contenuto della confezione", showPackageContent = "Mostra il contenuto della confezione",
showContainingFolder = "Mostra cartella contenente", showContainingFolder = "Mostra cartella contenente",
flashEEPROM = "Flash su EEPROM", flashEEPROM = "Flash su EEPROM",
flashingEEPROM = "Lampeggiante in corso. Non spegnere il computer", flashingEEPROM = "Lampeggiante in corso. Non spegnere il computer...",
sortBy = "Genere", sortBy = "Genere",
sortByType = "Per tipo", sortByType = "Per tipo",

View File

@ -83,7 +83,7 @@
showPackageContent = "Показать содержимое пакета", showPackageContent = "Показать содержимое пакета",
showContainingFolder = "Открыть содержащую папку", showContainingFolder = "Открыть содержащую папку",
flashEEPROM = "Записать на EEPROM", flashEEPROM = "Записать на EEPROM",
flashingEEPROM = "Идет прошивка. Не отключайте компьютер", flashingEEPROM = "Идет запись на EEPROM. Не отключайте компьютер...",
sortBy = "Упорядочить", sortBy = "Упорядочить",
sortByType = "По типу", sortByType = "По типу",

View File

@ -83,7 +83,7 @@
showPackageContent = "Показати вміст пакету", showPackageContent = "Показати вміст пакету",
showContainingFolder = "Показати папку", showContainingFolder = "Показати папку",
flashEEPROM = "Спалах до EEPROM", flashEEPROM = "Спалах до EEPROM",
flashingEEPROM = "Блимає в процесі. Не вимикати комп'ютер", flashingEEPROM = "Блимає в процесі. Не вимикати комп'ютер...",
sortBy = "Роду", sortBy = "Роду",
sortByType = "За типом", sortByType = "За типом",