add ui:editDialog
This commit is contained in:
29
shell-widget.lua
Normal file
29
shell-widget.lua
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user