Skip to content

Commit

Permalink
Added a button to go back from progress window
Browse files Browse the repository at this point in the history
It is possible to go back from the network window
pressing the esc key, but this is not possible
when the device has only a touchscreen / mouse.

Add a "Cancel" button to go back to the main window.

Signed-off-by: Stefano Babic <[email protected]>
  • Loading branch information
sbabic committed Dec 6, 2018
1 parent 84ab3fe commit 7c087c6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SWUpdateGUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ local progwin = ui.Window:new
Id = "message-box",
}
}
},
ui.Button:new
{
Id = "progress-cancel-button",
Text = L.BACK,
Disabled = true,
onClick = function(self)
app:switchwindow("network-window", "MainWindow")
end
}
}
}
Expand Down Expand Up @@ -489,6 +498,8 @@ app = ui.Application:new
msgUser = function(self,msg)
local prog = msg[-1]
self:switchtoprog(self)
g = self:getById("progress-cancel-button")
g:setValue("Disabled", true)
t = {}
for field in string.gmatch(prog, "%S+" ) do
k,v = string.match(field, "(%a+)=\'(.*)\'")
Expand Down Expand Up @@ -537,9 +548,13 @@ app = ui.Application:new
elseif status == STATUS_FAILURE then
g:setValue("Text", L.FAILURE)
g:setValue("Style", "color: #ff0000;")
g = self:getById("progress-cancel-button")
g:setValue("Disabled", false)
elseif status == STATUS_SUCCESS then
g:setValue("Text", L.SUCCESS)
g:setValue("Style", "color: #00ff00;")
g = self:getById("progress-cancel-button")
g:setValue("Disabled", false)
elseif status == STATUS_START then
g:setValue("Text", L.STARTING_UPDATE)
else
Expand Down

0 comments on commit 7c087c6

Please sign in to comment.