leave update plugin with ok button after the update process (we entered it with ok...
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 4 Jan 2006 22:55:19 +0000 (22:55 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 4 Jan 2006 22:55:19 +0000 (22:55 +0000)
lib/python/Plugins/update.py

index e919f38361921730239c8a2e0bc7388fda28204a..d05d317e2fb27fa25d5b816d233c1b229dc3a4c2 100644 (file)
@@ -24,11 +24,15 @@ class Example(Screen):
                        "back": self.close
                }, -1)
                
+               self.update = True
                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!"))            
+               if self.update:
+                       self.session.openWithCallback(self.doUpdate, MessageBox, _("Do you want to update your Dreambox?\nAfter pressing OK, please wait!"))            
+               else:
+                       self.close()
        
        def doUpdateDelay(self):
                lines = os.popen("ipkg update && ipkg upgrade", "r").readlines()
@@ -36,6 +40,7 @@ class Example(Screen):
                for x in lines:
                        string += x
                self["text"].setText(_("Updating finished. Here is the result:") + "\n\n" + string)
+               self.update = False
                        
        
        def doUpdate(self, val = False):