1
0
mirror of https://github.com/kepler155c/opus synced 2024-11-15 21:24:49 +00:00
opus/sys/apps/Version.lua

55 lines
1.2 KiB
Lua
Raw Normal View History

2020-05-01 03:27:07 +00:00
local Config = require('opus.config')
local UI = require('opus.ui')
local shell = _ENV.shell
local config = Config.load('version')
if not config.current then
return
end
UI:setPage(UI.Page {
2020-05-02 04:26:15 +00:00
UI.Text {
x = 2, y = 2, ex = -2,
align = 'center',
value = 'Opus has been updated.',
textColor = 'yellow',
},
2020-05-01 03:27:07 +00:00
UI.TextArea {
2020-05-02 04:26:15 +00:00
x = 2, y = 4, ey = -8,
2020-05-02 05:16:10 +00:00
value = config.details,
2020-05-01 03:27:07 +00:00
},
UI.Button {
2020-05-02 04:26:15 +00:00
x = 2, y = -6, width = 21,
2020-05-01 03:27:07 +00:00
event = 'skip',
text = 'Skip this version',
},
UI.Button {
2020-05-02 04:26:15 +00:00
x = 2, y = -4, width = 21,
2020-05-01 03:27:07 +00:00
event = 'remind',
text = 'Remind me tomorrow',
},
UI.Button {
2020-05-02 04:26:15 +00:00
x = 2, y = -2, width = 21,
2020-05-01 03:27:07 +00:00
event = 'update',
text = 'Update'
},
eventHandler = function(self, event)
if event.type == 'skip' then
config.skip = config.current
Config.update('version', config)
UI:quit()
elseif event.type == 'remind' then
UI:quit()
elseif event.type == 'update' then
shell.openForegroundTab('update update')
UI:quit()
end
return UI.Page.eventHandler(self, event)
end,
})
UI:start()