X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/549ed3c87c4d3fe093472aa199ca6742c1f3654f..0be83826dd31db1b88058bfc93528610afde2fda:/lib/python/Plugins/update.py diff --git a/lib/python/Plugins/update.py b/lib/python/Plugins/update.py index 756ed381..c0c1ecb5 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 @@ -15,7 +16,7 @@ class Example(Screen): 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"], { @@ -24,11 +25,18 @@ class Example(Screen): }, -1) def ok(self): - lines = os.popen("ipkg update && ipkg upgrade", "r").readlines() - string = "" - for x in lines: - string += x - self["text"].setText(string) + self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your Dreambox?\nAfter pressing OK, please wait!")) + + def doUpdate(self, val = False): + + if val: + lines = os.popen("ipkg update && ipkg upgrade", "r").readlines() + string = "" + for x in lines: + string += x + self["text"].setText(_("Updating finished. Here is the result:") + "\n\n" + string) + else: + self.close() def main(session): @@ -36,7 +44,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