milo shop updates
This commit is contained in:
74
milo/plugins/shopConfig.lua
Normal file
74
milo/plugins/shopConfig.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
local UI = require('ui')
|
||||
|
||||
local colors = _G.colors
|
||||
local device = _G.device
|
||||
|
||||
--[[ Configuration Page ]]--
|
||||
local wizardPage = UI.Window {
|
||||
title = 'Store Front',
|
||||
index = 2,
|
||||
backgroundColor = colors.cyan,
|
||||
form = UI.Form {
|
||||
x = 2, ex = -2, y = 2, ey = -4,
|
||||
manualControls = true,
|
||||
[1] = UI.TextEntry {
|
||||
formLabel = 'Domain', formKey = 'domain',
|
||||
help = 'Krist wallet domain (minus .kst)',
|
||||
limit = 64,
|
||||
shadowText = 'example',
|
||||
required = true,
|
||||
},
|
||||
[2] = UI.TextEntry {
|
||||
formLabel = 'Password', formKey = 'password',
|
||||
shadowText = 'password',
|
||||
limit = 64,
|
||||
required = true,
|
||||
help = 'Krist wallet password',
|
||||
},
|
||||
[3] = UI.TextEntry {
|
||||
formLabel = 'Header', formKey = 'header',
|
||||
help = 'Text to show in header',
|
||||
limit = 64,
|
||||
shadowText = "xxxx's shop",
|
||||
required = false,
|
||||
},
|
||||
[4] = UI.Chooser {
|
||||
width = 9,
|
||||
formLabel = 'Font Size', formKey = 'textScale',
|
||||
nochoice = 'Small',
|
||||
choices = {
|
||||
{ name = 'Small', value = .5 },
|
||||
{ name = 'Large', value = 1 },
|
||||
},
|
||||
help = 'Adjust text scaling',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
function wizardPage:setNode(node)
|
||||
self.form:setValues(node)
|
||||
end
|
||||
|
||||
function wizardPage:validate()
|
||||
return self.form:save()
|
||||
end
|
||||
|
||||
function wizardPage:saveNode(node)
|
||||
-- queue event ??
|
||||
end
|
||||
|
||||
function wizardPage:isValidType(node)
|
||||
local m = device[node.name]
|
||||
return m and m.type == 'monitor' and {
|
||||
name = 'Store Front',
|
||||
value = 'shop',
|
||||
category = 'display',
|
||||
help = 'Add a store front display'
|
||||
}
|
||||
end
|
||||
|
||||
function wizardPage:isValidFor(node)
|
||||
return node.mtype == 'shop'
|
||||
end
|
||||
|
||||
UI:getPage('nodeWizard').wizard:add({ storeFront = wizardPage })
|
||||
Reference in New Issue
Block a user