milo wip
This commit is contained in:
@@ -17,23 +17,33 @@ local SHIELD_SLOT = 2
|
||||
local config = Config.load('miloRemote', { })
|
||||
|
||||
local page = UI.Page {
|
||||
dummy = UI.Window {
|
||||
x = 1, ex = -13, y = 1, height = 1,
|
||||
menuBar = UI.MenuBar {
|
||||
y = 1, height = 1,
|
||||
buttons = {
|
||||
{
|
||||
text = 'Refresh',
|
||||
x = -12,
|
||||
event = 'refresh'
|
||||
},
|
||||
{
|
||||
text = '\206',
|
||||
x = -3,
|
||||
dropdown = {
|
||||
{ text = 'Setup', event = 'setup' },
|
||||
UI.MenuBar.spacer,
|
||||
{
|
||||
text = 'Rescan storage',
|
||||
event = 'rescan',
|
||||
help = 'Rescan all inventories'
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
infoBar = UI.StatusBar {
|
||||
x = 1, ex = -13,
|
||||
backgroundColor = colors.lightGray,
|
||||
},
|
||||
},
|
||||
refresh = UI.Button {
|
||||
y = 1, x = -12,
|
||||
event = 'refresh',
|
||||
text = 'Refresh',
|
||||
},
|
||||
setupButton = UI.Button {
|
||||
y = 1, x = -3,
|
||||
event = 'setup',
|
||||
text = '\206',
|
||||
help = 'Configuration',
|
||||
},
|
||||
grid = UI.Grid {
|
||||
y = 2, ey = -2,
|
||||
columns = {
|
||||
@@ -129,10 +139,6 @@ local page = UI.Page {
|
||||
[[bound introspection module. The neural interface must ]] ..
|
||||
[[also have an introspection module.]],
|
||||
},
|
||||
[5] = UI.Button {
|
||||
x = 1, y = -2,
|
||||
text = 'Force scan', event = 'rescan', help = 'Force a scan of all inventories',
|
||||
},
|
||||
},
|
||||
statusBar = UI.StatusBar {
|
||||
backgroundColor = colors.cyan,
|
||||
@@ -164,7 +170,7 @@ local function filterItems(t, filter, displayMode)
|
||||
end
|
||||
|
||||
function page:setStatus(status)
|
||||
self.dummy.infoBar:setStatus(status)
|
||||
self.menuBar.infoBar:setStatus(status)
|
||||
self:sync()
|
||||
end
|
||||
|
||||
@@ -273,12 +279,14 @@ function page:eventHandler(event)
|
||||
self.setup:hide()
|
||||
self:refresh('list')
|
||||
self.grid:draw()
|
||||
self:setFocus(self.statusBar.filter)
|
||||
|
||||
elseif event.type == 'form_cancel' then
|
||||
self.setup:hide()
|
||||
self:setFocus(self.statusBar.filter)
|
||||
|
||||
elseif event.type == 'focus_change' then
|
||||
self.dummy.infoBar:setStatus(event.focused.help)
|
||||
self.menuBar.infoBar:setStatus(event.focused.help)
|
||||
|
||||
elseif event.type == 'eject' or event.type == 'grid_select' then
|
||||
local item = self.grid:getSelected()
|
||||
|
||||
@@ -62,11 +62,11 @@ local jobMonitor = UI.Page {
|
||||
{ heading = 'Qty', key = 'remaining', width = 4 },
|
||||
{ heading = 'Crafting', key = 'displayName', },
|
||||
{ heading = 'Status', key = 'status', },
|
||||
-- { heading = 'need', key = 'need', width = 4 },
|
||||
{ heading = 'need', key = 'need', width = 4 },
|
||||
-- { heading = 'total', key = 'total', width = 4 },
|
||||
-- { heading = 'used', key = 'used', width = 4 },
|
||||
-- { heading = 'count', key = 'count', width = 4 },
|
||||
{ heading = 'crafted', key = 'crafted', width = 4 },
|
||||
{ heading = 'crafted', key = 'crafted', width = 5 },
|
||||
-- { heading = 'Progress', key = 'progress', width = 8 },
|
||||
},
|
||||
},
|
||||
|
||||
@@ -37,7 +37,19 @@ local listingPage = UI.Page {
|
||||
{ text = 'Craft', event = 'craft' },
|
||||
{ text = 'Edit', event = 'details' },
|
||||
{ text = 'Refresh', event = 'refresh', x = -12 },
|
||||
{ text = '\206', event = 'network', x = -3 },
|
||||
{
|
||||
text = '\206',
|
||||
x = -3,
|
||||
dropdown = {
|
||||
{ text = 'Setup', event = 'network' },
|
||||
UI.MenuBar.spacer,
|
||||
{
|
||||
text = 'Rescan storage',
|
||||
event = 'rescan',
|
||||
help = 'Rescan all inventories'
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
grid = UI.Grid {
|
||||
@@ -175,9 +187,14 @@ function listingPage:eventHandler(event)
|
||||
end
|
||||
|
||||
elseif event.type == 'refresh' then
|
||||
self:refresh()
|
||||
self.grid:draw()
|
||||
self:setFocus(self.statusBar.filter)
|
||||
|
||||
elseif event.type == 'rescan' then
|
||||
self:refresh(true)
|
||||
self.grid:draw()
|
||||
self.statusBar.filter:focus()
|
||||
self:setFocus(self.statusBar.filter)
|
||||
|
||||
elseif event.type == 'toggle_display' then
|
||||
local values = {
|
||||
|
||||
Reference in New Issue
Block a user