add ui:editDialog

This commit is contained in:
Evgeny
2021-07-30 18:51:37 +03:00
parent 56911fe1a4
commit 46407b5e78
3 changed files with 45 additions and 5 deletions

29
shell-widget.lua Normal file
View File

@@ -0,0 +1,29 @@
-- name = "Shell widget"
-- description = "Shows the result of executing console commands"
-- type = "widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
currentOutput = "empty"
function onResume()
redraw()
end
function redraw()
ui:showText(currentOutput)
end
function onClick(idx)
ui:showEditDialog("Enter command")
end
function onDialogAction(text)
system:exec(text)
end
function onShellResult(text)
currentOutput = text
redraw()
end