mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 11:09:21 +01:00
))
This commit is contained in:
parent
67d38da1ce
commit
3846eddc61
@ -1244,9 +1244,7 @@ local function toggleTopToolBar()
|
|||||||
calculateSizes()
|
calculateSizes()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function createEditOrRightClickMenu(x, y)
|
local function createEditOrRightClickMenu(menu)
|
||||||
local menu = GUI.addContextMenu(mainContainer, x, y)
|
|
||||||
|
|
||||||
menu:addItem(localization.cut, not codeView.selections[1], "^X").onTouch = function()
|
menu:addItem(localization.cut, not codeView.selections[1], "^X").onTouch = function()
|
||||||
cut()
|
cut()
|
||||||
end
|
end
|
||||||
@ -1311,14 +1309,12 @@ local function createEditOrRightClickMenu(x, y)
|
|||||||
menu:addItem(localization.clearBreakpoints, not breakpointLines, "^F9").onTouch = function()
|
menu:addItem(localization.clearBreakpoints, not breakpointLines, "^F9").onTouch = function()
|
||||||
clearBreakpoints()
|
clearBreakpoints()
|
||||||
end
|
end
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
codeView.eventHandler = function(mainContainer, object, e1, e2, e3, e4, e5)
|
codeView.eventHandler = function(mainContainer, object, e1, e2, e3, e4, e5)
|
||||||
if e1 == "touch" then
|
if e1 == "touch" then
|
||||||
if e5 == 1 then
|
if e5 == 1 then
|
||||||
createEditOrRightClickMenu(e3, e4)
|
createEditOrRightClickMenu(GUI.addContextMenu(mainContainer, e3, e4))
|
||||||
else
|
else
|
||||||
setCursorPositionAndClearSelection(convertScreenCoordinatesToTextPosition(e3, e4))
|
setCursorPositionAndClearSelection(convertScreenCoordinatesToTextPosition(e3, e4))
|
||||||
end
|
end
|
||||||
@ -1531,11 +1527,8 @@ leftTreeView.onItemSelected = function(path)
|
|||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
local topMenuMineCode = topMenu:addItem("MineCode", 0x0)
|
local MineCodeContextMenu = topMenu:addContextMenu("MineCode", 0x0)
|
||||||
topMenuMineCode.onTouch = function()
|
MineCodeContextMenu:addItem(localization.about).onTouch = function()
|
||||||
local menu = GUI.addContextMenu(mainContainer, topMenuMineCode.x, topMenuMineCode.y + 1)
|
|
||||||
|
|
||||||
menu:addItem(localization.about).onTouch = function()
|
|
||||||
local container = addBackgroundContainer(localization.about)
|
local container = addBackgroundContainer(localization.about)
|
||||||
|
|
||||||
local about = {
|
local about = {
|
||||||
@ -1561,91 +1554,71 @@ topMenuMineCode.onTouch = function()
|
|||||||
textBox:setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP)
|
textBox:setAlignment(GUI.ALIGNMENT_HORIZONTAL_CENTER, GUI.ALIGNMENT_VERTICAL_TOP)
|
||||||
textBox.eventHandler = nil
|
textBox.eventHandler = nil
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
|
||||||
end
|
|
||||||
|
|
||||||
menu:addItem(localization.quit, false, "^W").onTouch = function()
|
|
||||||
mainContainer:stopEventHandling()
|
|
||||||
end
|
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
local topMenuFile = topMenu:addItem(localization.file)
|
MineCodeContextMenu:addItem(localization.quit, false, "^W").onTouch = function()
|
||||||
topMenuFile.onTouch = function()
|
mainContainer:stopEventHandling()
|
||||||
local menu = GUI.addContextMenu(mainContainer, topMenuFile.x, topMenuFile.y + 1)
|
end
|
||||||
|
|
||||||
menu:addItem(localization.new, false, "^N").onTouch = function()
|
local fileContextMenu = topMenu:addContextMenu(localization.file)
|
||||||
|
fileContextMenu:addItem(localization.new, false, "^N").onTouch = function()
|
||||||
newFile()
|
newFile()
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(localization.open, false, "^O").onTouch = function()
|
fileContextMenu:addItem(localization.open, false, "^O").onTouch = function()
|
||||||
openFileWindow()
|
openFileWindow()
|
||||||
end
|
end
|
||||||
|
|
||||||
if component.isAvailable("internet") then
|
if component.isAvailable("internet") then
|
||||||
menu:addItem(localization.getFromWeb, false, "^U").onTouch = function()
|
fileContextMenu:addItem(localization.getFromWeb, false, "^U").onTouch = function()
|
||||||
downloadFileFromWeb()
|
downloadFileFromWeb()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
fileContextMenu:addSeparator()
|
||||||
|
|
||||||
menu:addItem(localization.save, not leftTreeView.selectedItem, "^S").onTouch = function()
|
fileContextMenu:addItem(localization.save, not leftTreeView.selectedItem, "^S").onTouch = function()
|
||||||
saveFileWindow()
|
saveFileWindow()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(localization.saveAs, false, "^⇧S").onTouch = function()
|
fileContextMenu:addItem(localization.saveAs, false, "^⇧S").onTouch = function()
|
||||||
saveFileAsWindow()
|
saveFileAsWindow()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(localization.launchWithArguments, false, "^F5").onTouch = function()
|
fileContextMenu:addItem(localization.launchWithArguments, false, "^F5").onTouch = function()
|
||||||
launchWithArgumentsWindow()
|
launchWithArgumentsWindow()
|
||||||
end
|
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local topMenuEdit = topMenu:addItem(localization.edit)
|
local topMenuEdit = topMenu:addContextMenu(localization.edit)
|
||||||
topMenuEdit.onTouch = function()
|
createEditOrRightClickMenu(topMenuEdit)
|
||||||
createEditOrRightClickMenu(topMenuEdit.x, topMenuEdit.y + 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
local topMenuGoto = topMenu:addItem(localization.gotoCyka)
|
local gotoContextMenu = topMenu:addContextMenu(localization.gotoCyka)
|
||||||
topMenuGoto.onTouch = function()
|
gotoContextMenu:addItem(localization.pageUp, false, "PgUp").onTouch = function()
|
||||||
local menu = GUI.addContextMenu(mainContainer, topMenuGoto.x, topMenuGoto.y + 1)
|
|
||||||
|
|
||||||
menu:addItem(localization.pageUp, false, "PgUp").onTouch = function()
|
|
||||||
pageUp()
|
pageUp()
|
||||||
end
|
|
||||||
|
|
||||||
menu:addItem(localization.pageDown, false, "PgDn").onTouch = function()
|
|
||||||
pageDown()
|
|
||||||
end
|
|
||||||
|
|
||||||
menu:addItem(localization.gotoStart, false, "Home").onTouch = function()
|
|
||||||
setCursorPositionToHome()
|
|
||||||
end
|
|
||||||
|
|
||||||
menu:addItem(localization.gotoEnd, false, "End").onTouch = function()
|
|
||||||
setCursorPositionToEnd()
|
|
||||||
end
|
|
||||||
|
|
||||||
menu:addSeparator()
|
|
||||||
|
|
||||||
menu:addItem(localization.gotoLine, false, "^L").onTouch = function()
|
|
||||||
gotoLineWindow()
|
|
||||||
end
|
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local topMenuProperties = topMenu:addItem(localization.properties)
|
gotoContextMenu:addItem(localization.pageDown, false, "PgDn").onTouch = function()
|
||||||
topMenuProperties.onTouch = function()
|
pageDown()
|
||||||
local menu = GUI.addContextMenu(mainContainer, topMenuProperties.x, topMenuProperties.y + 1)
|
end
|
||||||
|
|
||||||
menu:addItem(localization.colorScheme).onTouch = function()
|
gotoContextMenu:addItem(localization.gotoStart, false, "Home").onTouch = function()
|
||||||
|
setCursorPositionToHome()
|
||||||
|
end
|
||||||
|
|
||||||
|
gotoContextMenu:addItem(localization.gotoEnd, false, "End").onTouch = function()
|
||||||
|
setCursorPositionToEnd()
|
||||||
|
end
|
||||||
|
|
||||||
|
gotoContextMenu:addSeparator()
|
||||||
|
|
||||||
|
gotoContextMenu:addItem(localization.gotoLine, false, "^L").onTouch = function()
|
||||||
|
gotoLineWindow()
|
||||||
|
end
|
||||||
|
|
||||||
|
local propertiesContextMenu = topMenu:addContextMenu(localization.properties)
|
||||||
|
propertiesContextMenu:addItem(localization.colorScheme).onTouch = function()
|
||||||
local container = GUI.addBackgroundContainer(mainContainer, true, false, localization.colorScheme)
|
local container = GUI.addBackgroundContainer(mainContainer, true, false, localization.colorScheme)
|
||||||
|
|
||||||
local colorSelectorsCount, colorSelectorCountX = 0, 4; for key in pairs(config.syntaxColorScheme) do colorSelectorsCount = colorSelectorsCount + 1 end
|
local colorSelectorsCount, colorSelectorCountX = 0, 4; for key in pairs(config.syntaxColorScheme) do colorSelectorsCount = colorSelectorsCount + 1 end
|
||||||
@ -1678,9 +1651,9 @@ topMenuProperties.onTouch = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(localization.cursorProperties).onTouch = function()
|
propertiesContextMenu:addItem(localization.cursorProperties).onTouch = function()
|
||||||
local container = addBackgroundContainer(localization.cursorProperties)
|
local container = addBackgroundContainer(localization.cursorProperties)
|
||||||
|
|
||||||
local input = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xC3C3C3, 0x787878, 0x787878, 0xC3C3C3, 0x2D2D2D, config.cursorSymbol, localization.cursorSymbol))
|
local input = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xC3C3C3, 0x787878, 0x787878, 0xC3C3C3, 0x2D2D2D, config.cursorSymbol, localization.cursorSymbol))
|
||||||
@ -1704,31 +1677,28 @@ topMenuProperties.onTouch = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
if topToolBar.hidden then
|
if topToolBar.hidden then
|
||||||
menu:addItem(localization.toggleTopToolBar).onTouch = function()
|
propertiesContextMenu:addItem(localization.toggleTopToolBar).onTouch = function()
|
||||||
toggleTopToolBar()
|
toggleTopToolBar()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
propertiesContextMenu:addSeparator()
|
||||||
|
|
||||||
menu:addItem(config.syntaxHighlight and localization.disableSyntaxHighlight or localization.enableSyntaxHighlight).onTouch = function()
|
propertiesContextMenu:addItem(config.syntaxHighlight and localization.disableSyntaxHighlight or localization.enableSyntaxHighlight).onTouch = function()
|
||||||
syntaxHighlightingButton.pressed = not syntaxHighlightingButton.pressed
|
syntaxHighlightingButton.pressed = not syntaxHighlightingButton.pressed
|
||||||
syntaxHighlightingButton.onTouch()
|
syntaxHighlightingButton.onTouch()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(config.enableAutoBrackets and localization.disableAutoBrackets or localization.enableAutoBrackets, false, "^]").onTouch = function()
|
propertiesContextMenu:addItem(config.enableAutoBrackets and localization.disableAutoBrackets or localization.enableAutoBrackets, false, "^]").onTouch = function()
|
||||||
config.enableAutoBrackets = not config.enableAutoBrackets
|
config.enableAutoBrackets = not config.enableAutoBrackets
|
||||||
saveConfig()
|
saveConfig()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(config.enableAutocompletion and localization.disableAutocompletion or localization.enableAutocompletion, false, "^I").onTouch = function()
|
propertiesContextMenu:addItem(config.enableAutocompletion and localization.disableAutocompletion or localization.enableAutocompletion, false, "^I").onTouch = function()
|
||||||
toggleEnableAutocompleteDatabase()
|
toggleEnableAutocompleteDatabase()
|
||||||
end
|
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
leftTreeViewResizer.onResize = function(dragWidth, dragHeight)
|
leftTreeViewResizer.onResize = function(dragWidth, dragHeight)
|
||||||
|
|||||||
@ -339,15 +339,12 @@ end
|
|||||||
|
|
||||||
mainContainer.menu:addItem("PE", 0x00B6FF)
|
mainContainer.menu:addItem("PE", 0x00B6FF)
|
||||||
|
|
||||||
local fileItem = mainContainer.menu:addItem("File")
|
local fileItem = mainContainer.menu:addContextMenu("File")
|
||||||
fileItem.onTouch = function()
|
fileItem:addItem("New").onTouch = new
|
||||||
local menu = GUI.addContextMenu(mainContainer, fileItem.x, fileItem.y + 1)
|
|
||||||
|
|
||||||
menu:addItem("New").onTouch = new
|
fileItem:addSeparator()
|
||||||
|
|
||||||
menu:addSeparator()
|
fileItem:addItem("Open").onTouch = function()
|
||||||
|
|
||||||
menu:addItem("Open").onTouch = function()
|
|
||||||
local filesystemDialog = GUI.addFilesystemDialog(mainContainer, true, 50, math.floor(mainContainer.height * 0.8), "Open", "Cancel", "File name", "/")
|
local filesystemDialog = GUI.addFilesystemDialog(mainContainer, true, 50, math.floor(mainContainer.height * 0.8), "Open", "Cancel", "File name", "/")
|
||||||
filesystemDialog:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
|
filesystemDialog:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
|
||||||
filesystemDialog:addExtensionFilter(".pic")
|
filesystemDialog:addExtensionFilter(".pic")
|
||||||
@ -358,17 +355,17 @@ fileItem.onTouch = function()
|
|||||||
loadImage(path)
|
loadImage(path)
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local subMenu = menu:addSubMenu("Open recent", #config.recentFiles == 0)
|
local fileItemSubMenu = fileItem:addSubMenu("Open recent", #config.recentFiles == 0)
|
||||||
for i = 1, #config.recentFiles do
|
for i = 1, #config.recentFiles do
|
||||||
subMenu:addItem(string.limit(config.recentFiles[i], 32, "left")).onTouch = function()
|
fileItemSubMenu:addItem(string.limit(config.recentFiles[i], 32, "left")).onTouch = function()
|
||||||
loadImage(config.recentFiles[i])
|
loadImage(config.recentFiles[i])
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem("Open from URL").onTouch = function()
|
fileItem:addItem("Open from URL").onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(mainContainer, "Open from URL")
|
local container = MineOSInterface.addBackgroundContainer(mainContainer, "Open from URL")
|
||||||
|
|
||||||
local input = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, "", "http://example.com/test.pic"))
|
local input = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x969696, 0xE1E1E1, 0x2D2D2D, "", "http://example.com/test.pic"))
|
||||||
@ -396,15 +393,15 @@ fileItem.onTouch = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
fileItem:addSeparator()
|
||||||
|
|
||||||
menu:addItem("Save", not savePath).onTouch = function()
|
fileItem:addItem("Save", not savePath).onTouch = function()
|
||||||
saveImage(savePath)
|
saveImage(savePath)
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem("Save as").onTouch = function()
|
fileItem:addItem("Save as").onTouch = function()
|
||||||
local filesystemDialog = GUI.addFilesystemDialog(mainContainer, true, 50, math.floor(mainContainer.height * 0.8), "Save", "Cancel", "File name", "/")
|
local filesystemDialog = GUI.addFilesystemDialog(mainContainer, true, 50, math.floor(mainContainer.height * 0.8), "Save", "Cancel", "File name", "/")
|
||||||
filesystemDialog:setMode(GUI.IO_MODE_SAVE, GUI.IO_MODE_FILE)
|
filesystemDialog:setMode(GUI.IO_MODE_SAVE, GUI.IO_MODE_FILE)
|
||||||
filesystemDialog:addExtensionFilter(".pic")
|
filesystemDialog:addExtensionFilter(".pic")
|
||||||
@ -415,15 +412,12 @@ fileItem.onTouch = function()
|
|||||||
filesystemDialog.onSubmit = function(path)
|
filesystemDialog.onSubmit = function(path)
|
||||||
saveImage(path)
|
saveImage(path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
fileItem:addSeparator()
|
||||||
|
|
||||||
menu:addItem("Exit").onTouch = function()
|
fileItem:addItem("Exit").onTouch = function()
|
||||||
mainContainer:stopEventHandling()
|
mainContainer:stopEventHandling()
|
||||||
end
|
|
||||||
|
|
||||||
mainContainer:drawOnScreen()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
mainContainer.menu:addItem("View").onTouch = function()
|
mainContainer.menu:addItem("View").onTouch = function()
|
||||||
|
|||||||
59
OS.lua
59
OS.lua
@ -512,11 +512,9 @@ local function createOSWidgets()
|
|||||||
MineOSInterface.mainContainer.windowsContainer = MineOSInterface.mainContainer:addChild(GUI.container(1, 2, 1, 1))
|
MineOSInterface.mainContainer.windowsContainer = MineOSInterface.mainContainer:addChild(GUI.container(1, 2, 1, 1))
|
||||||
|
|
||||||
MineOSInterface.mainContainer.menu = MineOSInterface.mainContainer:addChild(GUI.menu(1, 1, MineOSInterface.mainContainer.width, MineOSCore.properties.menuColor, 0x696969, 0x3366CC, 0xFFFFFF))
|
MineOSInterface.mainContainer.menu = MineOSInterface.mainContainer:addChild(GUI.menu(1, 1, MineOSInterface.mainContainer.width, MineOSCore.properties.menuColor, 0x696969, 0x3366CC, 0xFFFFFF))
|
||||||
local item1 = MineOSInterface.mainContainer.menu:addItem("MineOS", 0x000000)
|
|
||||||
item1.onTouch = function()
|
|
||||||
local menu = MineOSInterface.addContextMenu(MineOSInterface.mainContainer, item1.x, item1.y + 1)
|
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.aboutSystem).onTouch = function()
|
local MineOSContextMenu = MineOSInterface.mainContainer.menu:addContextMenu("MineOS", 0x000000)
|
||||||
|
MineOSContextMenu:addItem(MineOSCore.localization.aboutSystem).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.aboutSystem)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.aboutSystem)
|
||||||
container.layout:setFitting(2, 1, false, false)
|
container.layout:setFitting(2, 1, false, false)
|
||||||
container.layout:removeChildren()
|
container.layout:removeChildren()
|
||||||
@ -559,40 +557,37 @@ local function createOSWidgets()
|
|||||||
MineOSInterface.mainContainer:drawOnScreen()
|
MineOSInterface.mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.updates).onTouch = function()
|
MineOSContextMenu:addItem(MineOSCore.localization.updates).onTouch = function()
|
||||||
MineOSInterface.safeLaunch(MineOSPaths.applications .. "App Market.app/Main.lua", "updates")
|
MineOSInterface.safeLaunch(MineOSPaths.applications .. "App Market.app/Main.lua", "updates")
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
MineOSContextMenu:addSeparator()
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.logout, MineOSCore.properties.protectionMethod == "withoutProtection").onTouch = function()
|
MineOSContextMenu:addItem(MineOSCore.localization.logout, MineOSCore.properties.protectionMethod == "withoutProtection").onTouch = function()
|
||||||
login()
|
login()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.reboot).onTouch = function()
|
MineOSContextMenu:addItem(MineOSCore.localization.reboot).onTouch = function()
|
||||||
MineOSNetwork.broadcastComputerState(false)
|
MineOSNetwork.broadcastComputerState(false)
|
||||||
require("computer").shutdown(true)
|
require("computer").shutdown(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.shutdown).onTouch = function()
|
MineOSContextMenu:addItem(MineOSCore.localization.shutdown).onTouch = function()
|
||||||
MineOSNetwork.broadcastComputerState(false)
|
MineOSNetwork.broadcastComputerState(false)
|
||||||
require("computer").shutdown()
|
require("computer").shutdown()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
MineOSContextMenu:addSeparator()
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.returnToShell).onTouch = function()
|
MineOSContextMenu:addItem(MineOSCore.localization.returnToShell).onTouch = function()
|
||||||
MineOSNetwork.broadcastComputerState(false)
|
MineOSNetwork.broadcastComputerState(false)
|
||||||
MineOSInterface.mainContainer:stopEventHandling()
|
MineOSInterface.mainContainer:stopEventHandling()
|
||||||
MineOSInterface.clearTerminal()
|
MineOSInterface.clearTerminal()
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
|
||||||
MineOSInterface.mainContainer:drawOnScreen()
|
local networkItem = MineOSInterface.mainContainer.menu:addItem(MineOSCore.localization.network)
|
||||||
end
|
networkItem.onTouch = function()
|
||||||
|
|
||||||
local item2 = MineOSInterface.mainContainer.menu:addItem(MineOSCore.localization.network)
|
|
||||||
item2.onTouch = function()
|
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.network)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.network)
|
||||||
local insertModemTextBox = container.layout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x5A5A5A, {MineOSCore.localization.networkModemNotAvailable}, 1, 0, 0, true, true))
|
local insertModemTextBox = container.layout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x5A5A5A, {MineOSCore.localization.networkModemNotAvailable}, 1, 0, 0, true, true))
|
||||||
local stateSwitchAndLabel = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x2D2D2D, 0xE1E1E1, 0x878787, MineOSCore.localization.networkState .. ":", MineOSCore.properties.network.enabled))
|
local stateSwitchAndLabel = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x2D2D2D, 0xE1E1E1, 0x878787, MineOSCore.localization.networkState .. ":", MineOSCore.properties.network.enabled))
|
||||||
@ -682,12 +677,9 @@ local function createOSWidgets()
|
|||||||
check()
|
check()
|
||||||
end
|
end
|
||||||
|
|
||||||
local item3 = MineOSInterface.mainContainer.menu:addItem(MineOSCore.localization.settings)
|
local settingsContextMenu = MineOSInterface.mainContainer.menu:addContextMenu(MineOSCore.localization.settings)
|
||||||
item3.onTouch = function()
|
|
||||||
local menu = MineOSInterface.addContextMenu(MineOSInterface.mainContainer, item3.x, item3.y + 1)
|
|
||||||
|
|
||||||
if computer.getArchitectures then
|
if computer.getArchitectures then
|
||||||
menu:addItem(MineOSCore.localization.CPUArchitecture).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.CPUArchitecture).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.CPUArchitecture)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.CPUArchitecture)
|
||||||
|
|
||||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
||||||
@ -707,7 +699,7 @@ local function createOSWidgets()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.RAMControl).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.RAMControl).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.RAMControl)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.RAMControl)
|
||||||
|
|
||||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
||||||
@ -744,7 +736,7 @@ local function createOSWidgets()
|
|||||||
update()
|
update()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.screenResolution).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.screenResolution).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.screenResolution)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.screenResolution)
|
||||||
|
|
||||||
local widthTextBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x878787, 0xE1E1E1, 0x2D2D2D, tostring(MineOSCore.properties.resolution and MineOSCore.properties.resolution[1] or 160), "Width", true))
|
local widthTextBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0x878787, 0xE1E1E1, 0x2D2D2D, tostring(MineOSCore.properties.resolution and MineOSCore.properties.resolution[1] or 160), "Width", true))
|
||||||
@ -771,9 +763,9 @@ local function createOSWidgets()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
settingsContextMenu:addSeparator()
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.systemLanguage).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.systemLanguage).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.systemLanguage)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.systemLanguage)
|
||||||
|
|
||||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
||||||
@ -798,7 +790,7 @@ local function createOSWidgets()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.wallpaper).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.wallpaper).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.wallpaper)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.wallpaper)
|
||||||
|
|
||||||
local filesystemChooser = container.layout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696, MineOSCore.properties.wallpaper, MineOSCore.localization.open, MineOSCore.localization.cancel, MineOSCore.localization.wallpaperPath, "/"))
|
local filesystemChooser = container.layout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696, MineOSCore.properties.wallpaper, MineOSCore.localization.open, MineOSCore.localization.cancel, MineOSCore.localization.wallpaperPath, "/"))
|
||||||
@ -847,7 +839,7 @@ local function createOSWidgets()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.screensaver).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.screensaver).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.screensaver)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.screensaver)
|
||||||
|
|
||||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
||||||
@ -877,7 +869,7 @@ local function createOSWidgets()
|
|||||||
MineOSInterface.mainContainer:drawOnScreen()
|
MineOSInterface.mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.colorScheme).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.colorScheme).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.colorScheme)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.colorScheme)
|
||||||
|
|
||||||
local backgroundColorSelector = container.layout:addChild(GUI.colorSelector(1, 1, 36, 3, MineOSCore.properties.backgroundColor, MineOSCore.localization.backgroundColor))
|
local backgroundColorSelector = container.layout:addChild(GUI.colorSelector(1, 1, 36, 3, MineOSCore.properties.backgroundColor, MineOSCore.localization.backgroundColor))
|
||||||
@ -917,7 +909,7 @@ local function createOSWidgets()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.iconProperties).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.iconProperties).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.iconProperties)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.iconProperties)
|
||||||
|
|
||||||
local showExtensionSwitch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x2D2D2D, 0xE1E1E1, 0x878787, MineOSCore.localization.showExtension .. ":", MineOSCore.properties.showExtension)).switch
|
local showExtensionSwitch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x2D2D2D, 0xE1E1E1, 0x878787, MineOSCore.localization.showExtension .. ":", MineOSCore.properties.showExtension)).switch
|
||||||
@ -959,7 +951,7 @@ local function createOSWidgets()
|
|||||||
showHiddenFilesSwitch.onStateChanged, showApplicationIconsSwitch.onStateChanged = showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged
|
showHiddenFilesSwitch.onStateChanged, showApplicationIconsSwitch.onStateChanged = showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.dateAndTime).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.dateAndTime).onTouch = function()
|
||||||
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.timezone)
|
local container = MineOSInterface.addBackgroundContainer(MineOSInterface.mainContainer, MineOSCore.localization.timezone)
|
||||||
|
|
||||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x4B4B4B, 0x969696))
|
||||||
@ -990,15 +982,12 @@ local function createOSWidgets()
|
|||||||
MineOSInterface.mainContainer:drawOnScreen()
|
MineOSInterface.mainContainer:drawOnScreen()
|
||||||
end
|
end
|
||||||
|
|
||||||
menu:addSeparator()
|
settingsContextMenu:addSeparator()
|
||||||
|
|
||||||
menu:addItem(MineOSCore.localization.setProtectionMethod).onTouch = function()
|
settingsContextMenu:addItem(MineOSCore.localization.setProtectionMethod).onTouch = function()
|
||||||
setProtectionMethod()
|
setProtectionMethod()
|
||||||
end
|
end
|
||||||
|
|
||||||
MineOSInterface.mainContainer:drawOnScreen()
|
|
||||||
end
|
|
||||||
|
|
||||||
MineOSInterface.mainContainer.menuLayout = MineOSInterface.mainContainer:addChild(GUI.layout(1, 1, 1, 1, 1, 1))
|
MineOSInterface.mainContainer.menuLayout = MineOSInterface.mainContainer:addChild(GUI.layout(1, 1, 1, 1, 1, 1))
|
||||||
MineOSInterface.mainContainer.menuLayout:setDirection(1, 1, GUI.DIRECTION_HORIZONTAL)
|
MineOSInterface.mainContainer.menuLayout:setDirection(1, 1, GUI.DIRECTION_HORIZONTAL)
|
||||||
MineOSInterface.mainContainer.menuLayout:setAlignment(1, 1, GUI.ALIGNMENT_HORIZONTAL_RIGHT, GUI.ALIGNMENT_VERTICAL_TOP)
|
MineOSInterface.mainContainer.menuLayout:setAlignment(1, 1, GUI.ALIGNMENT_HORIZONTAL_RIGHT, GUI.ALIGNMENT_VERTICAL_TOP)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user