change iFrontendInformation api
[enigma2.git] / lib / python / Screens / PluginBrowser.py
index afc283d524301c4a99f630ab27e984f1cbc27f8a..fe81a33d48f05d555b012b4fb8e18a389aeff9f8 100644 (file)
@@ -31,7 +31,16 @@ class PluginBrowser(Screen):
                        "red": self.delete,
                        "green": self.download
                })
-               
+               self.onExecBegin.append(self.checkWarnings)
+       
+       def checkWarnings(self):
+               if len(plugins.warnings):
+                       text = _("Some plugins are not available:\n")
+                       for (pluginname, error) in plugins.warnings:
+                               text += _("%s (%s)\n") % (pluginname, error)
+                       plugins.resetWarnings()
+                       self.session.open(MessageBox, text = text, type = MessageBox.TYPE_WARNING)
+
        def save(self):
                #self.close()
                self.run()
@@ -74,6 +83,7 @@ class PluginDownloadBrowser(Screen):
                self["list"] = PluginList(self.list)
                self.pluginlist = []
                self.expanded = []
+               self.installedplugins = []
                
                if self.type == self.DOWNLOAD:
                        self["text"] = Label(_("Downloading plugin information. Please wait..."))
@@ -130,21 +140,28 @@ class PluginDownloadBrowser(Screen):
                if self.run == 0:
                        self.run = 1
                        if self.type == self.DOWNLOAD:
-                               self.container.execute("ipkg list enigma2-plugin-*")
+                               self.container.execute("ipkg list_installed enigma2-plugin-*")
+               elif self.run == 1 and self.type == self.DOWNLOAD:
+                       self.run = 2
+                       self.container.execute("ipkg list enigma2-plugin-*")
                else:
                        if len(self.pluginlist) > 0:
                                self.updateList()
                                self["list"].instance.show()
                        else:
-                               self["text"].setText("No plugins found")
+                               self["text"].setText("No new plugins found")
 
        def dataAvail(self, str):
                for x in str.split('\n'):
                        plugin = x.split(" - ")
                        if len(plugin) == 3:
-                               plugin.append(plugin[0][15:])
+                               if self.run == 1 and self.type == self.DOWNLOAD:
+                                       self.installedplugins.append(plugin[0])
+                               else:
+                                       if plugin[0] not in self.installedplugins:
+                                               plugin.append(plugin[0][15:])
 
-                               self.pluginlist.append(plugin)
+                                               self.pluginlist.append(plugin)
        
        def updateList(self):
                self.list = []