X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7fe27f601f70eddb3019e22cbdb8388c05d3af7e..61ea204d226d23041b40248f3b2336fbb2f53b77:/lib/python/Plugins/update.py diff --git a/lib/python/Plugins/update.py b/lib/python/Plugins/update.py index 7126875b..e919f383 100644 --- a/lib/python/Plugins/update.py +++ b/lib/python/Plugins/update.py @@ -1,5 +1,6 @@ from enigma import * from Screens.Screen import Screen +from Screens.MessageBox import MessageBox from Components.ActionMap import ActionMap from Components.Label import Label @@ -8,27 +9,41 @@ import os class Example(Screen): skin = """ - + """ def __init__(self, session): self.skin = Example.skin Screen.__init__(self, session) - self["text"] = Label("Press OK to upgrade") + self["text"] = Label(_("Please press OK!")) self["actions"] = ActionMap(["WizardActions"], { - "ok": self.ok, + "ok": self.go, "back": self.close }, -1) - def ok(self): + self.delayTimer = eTimer() + self.delayTimer.timeout.get().append(self.doUpdateDelay) + + def go(self): + self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your Dreambox?\nAfter pressing OK, please wait!")) + + def doUpdateDelay(self): lines = os.popen("ipkg update && ipkg upgrade", "r").readlines() string = "" for x in lines: string += x - self["text"].setText(string) + self["text"].setText(_("Updating finished. Here is the result:") + "\n\n" + string) + + + def doUpdate(self, val = False): + if val == True: + self["text"].setText(_("Updating... Please wait... This can take some minutes...")) + self.delayTimer.start(0, 1) + else: + self.close() def main(session): @@ -36,7 +51,7 @@ def main(session): def getPicturePath(): - return "" + return "/usr/lib/enigma2/python/Plugins/update.png" def getPluginName(): return "Softwareupdate" \ No newline at end of file