From 12aacaaf0ba2eb1eb61e46626019a13d5493a177 Mon Sep 17 00:00:00 2001 From: Stefano Babic Date: Mon, 14 Oct 2019 16:48:37 +0200 Subject: [PATCH] Automatic start a bundle update Signed-off-by: Stefano Babic --- SWUpdateGUI.lua | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/SWUpdateGUI.lua b/SWUpdateGUI.lua index e61ede9..867d63b 100755 --- a/SWUpdateGUI.lua +++ b/SWUpdateGUI.lua @@ -917,20 +917,7 @@ app = ui.Application:new onClick = function(self) local count = 1 local app = self.Application - local w, h = app:getById("MainWindow").Drawable:getAttrs("WH") - local singleupd = searchupd(MEDIAPATH) - swulist = {} - if singleupd then - db.info ("Found Update File : " .. singleupd) - swulist = updtoswulist(MEDIAPATH, singleupd) - numswusinupd = #swulist - automaticreboot = true - app:addCoroutine(function() - app:sendswu(swulist) - end) - else - app:switchwindow("filebox-window") - end + app:switchwindow("filebox-window") end }, Button:new @@ -1018,7 +1005,17 @@ progwin:setValue("Status", "hide") netwin:setValue("Status", "hide") app:addMember(progwin) -app:switchwindow("filebox-window") +local singleupd = searchupd(MEDIAPATH) +swulist = {} +if singleupd then + db.info ("Found Update File : " .. singleupd) + swulist = updtoswulist(MEDIAPATH, singleupd) + numswusinupd = #swulist + automaticreboot = true + app:addCoroutine(function() + app:sendswu(swulist) + end) +end app:run()