new plugin interface
[enigma2.git] / lib / python / Plugins / update / plugin.py
index 90846f0410b9861a2a93c49148839e019d873613..070c199c645ac13aba0bb05afa6353a2253140bf 100644 (file)
@@ -2,8 +2,9 @@ from enigma import *
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import ActionMap
-from Components.Label import Label
+from Components.ScrollLabel import ScrollLabel
 from Components.GUIComponent import *
+from Plugins.Plugin import PluginDescriptor
 
 import os
 
@@ -17,12 +18,14 @@ class Upgrade(Screen):
                self.skin = Upgrade.skin
                Screen.__init__(self, session)
 
-               self["text"] = Label(_("Please press OK!"))
+               self["text"] = ScrollLabel(_("Please press OK!"))
                                
-               self["actions"] = ActionMap(["WizardActions"], 
+               self["actions"] = ActionMap(["WizardActions", "DirectionActions"], 
                {
                        "ok": self.go,
-                       "back": self.close
+                       "back": self.close,
+                       "up": self["text"].pageUp,
+                       "down": self["text"].pageDown
                }, -1)
                
                self.update = True
@@ -36,7 +39,7 @@ class Upgrade(Screen):
                        self.close()
        
        def doUpdateDelay(self):
-               lines = os.popen("ipkg update && ipkg upgrade", "r").readlines()
+               lines = os.popen("ipkg update && ipkg upgrade -force-defaults -force-overwrite", "r").readlines()
                string = ""
                for x in lines:
                        string += x
@@ -159,23 +162,8 @@ class Ipkg(Screen):
                else:
                        self.close()
 
+def main(session):
+       session.open(Upgrade)
 
-
-def autostart():
-       return
-       os.popen("ipkg update", "r")    
-#
-#def autoend():
-       #print "**************************** AUTOEND"
-
-def getPicturePaths():
-       return ["update.png", "update.png"]
-
-def getPlugins():
-       return [("Softwareupdate", "Updates your receiver's software", "screen", "Upgrade"),
-                       ("IPKG", "Updates your receiver's software", "screen", "Ipkg")]
-       
-def getMenuRegistrationList():
-       list = []
-       list.append(("setup", 2, "Softwareupdate", "Upgrade"))
-       return list
\ No newline at end of file
+def Plugins():
+       return PluginDescriptor(name="Softwareupdate", description="Updates your receiver's software", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)