diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-10-17 22:37:39 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-10-17 22:37:39 +0000 |
| commit | 948213ba7e5d1bc6a9c4d7f5f9d35c53186b60d3 (patch) | |
| tree | 5a6d10d8ebcc2aa4ce9d71b53613552e18792f6e /lib/python | |
| parent | 226d5ace683c1ac845d3a00fd9f5d2489c2eddcd (diff) | |
| download | enigma2-948213ba7e5d1bc6a9c4d7f5f9d35c53186b60d3.tar.gz enigma2-948213ba7e5d1bc6a9c4d7f5f9d35c53186b60d3.zip | |
ask user to reboot dreambox after software update
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py | 13 | ||||
| -rw-r--r-- | lib/python/Screens/Console.py | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py index c0649b13..e12729b5 100644 --- a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py @@ -7,6 +7,7 @@ from Components.GUIComponent import * from Components.MenuList import MenuList from Components.Input import Input from Screens.Console import Console +from Screens.MessageBox import MessageBox from Plugins.Plugin import PluginDescriptor from Screens.ImageWizard import ImageWizard @@ -57,9 +58,19 @@ class UpdatePluginMenu(Screen): self.session.open(Ipkg) elif (self["menu"].l.getCurrentSelection()[1] == "setup"): self.session.open(MessageBox, _("Function not yet implemented"), MessageBox.TYPE_ERROR) + def runUpgrade(self, result): if result: - self.session.open(Console, title = "Upgrade running...", cmdlist = ["ipkg update", "ipkg upgrade -force-defaults -force-overwrite"]) + self.session.open(Console, title = "Upgrade running...", cmdlist = ["ipkg update", "ipkg upgrade -force-defaults -force-overwrite"], finishedCallback = self.runFinished) + + def runFinished(self): + self.session.openWithCallback(self.reboot, MessageBox, _("Upgrade finished. Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) + + def reboot(self, result): + if result is None: + return + if result: + quitMainloop(3) class IPKGSource(Screen): skin = """ diff --git a/lib/python/Screens/Console.py b/lib/python/Screens/Console.py index 98c373d5..03b0249b 100644 --- a/lib/python/Screens/Console.py +++ b/lib/python/Screens/Console.py @@ -10,10 +10,12 @@ class Console(Screen): <widget name="text" position="0,0" size="550,400" font="Regular;15" /> </screen>""" - def __init__(self, session, title = "Console", cmdlist = None): + def __init__(self, session, title = "Console", cmdlist = None, finishedCallback = None): self.skin = Console.skin Screen.__init__(self, session) + self.finishedCallback = finishedCallback + self["text"] = ScrollLabel("") self["actions"] = ActionMap(["WizardActions", "DirectionActions"], { @@ -50,6 +52,8 @@ class Console(Screen): str = self["text"].getText() str += _("Execution finished!!"); self["text"].setText(str) + if self.finishedCallback is not None: + self.finishedCallback() def cancel(self): if self.run == len(self.cmdlist): |
