update pluginlist after downloading a plugin
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Thu, 23 Feb 2006 00:22:33 +0000 (00:22 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Thu, 23 Feb 2006 00:22:33 +0000 (00:22 +0000)
lib/python/Screens/PluginBrowser.py

index 67aac07656906a6d853edc200a63990f24e52512..429163ee4cdbbdbad9791120358089835e70e453 100644 (file)
@@ -11,6 +11,7 @@ from Components.Label import Label
 from Screens.MessageBox import MessageBox
 from Screens.Console import Console
 from Plugins.Plugin import PluginDescriptor
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS
 
 class PluginBrowser(Screen):
        def __init__(self, session):
@@ -52,7 +53,7 @@ class PluginBrowser(Screen):
                pass
        
        def download(self):
-               self.session.open(PluginDownloadBrowser)
+               self.session.openWithCallback(self.updateList, PluginDownloadBrowser)
 
 class PluginDownloadBrowser(Screen):
        def __init__(self, session):
@@ -83,12 +84,15 @@ class PluginDownloadBrowser(Screen):
                
        def runInstall(self, val):
                if val:
-                       self.session.open(Console, ["ipkg install " + self.pluginlist[self["list"].l.getCurrentSelectionIndex()][0]])
+                       self.session.openWithCallback(self.installFinished, Console, ["ipkg install " + self.pluginlist[self["list"].l.getCurrentSelectionIndex()][0]])
 
        def startRun(self):
                self["list"].instance.hide()
                self.container.execute("ipkg update")
                
+       def installFinished(self):
+               plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
+               
        def runFinished(self, retval):
                if self.run == 0:
                        self.run = 1