get rid of unneede global keywords
[enigma2.git] / lib / python / Screens / PluginBrowser.py
index 41b3f32eda0c2c2703885050385fe93a631a494a..f5d0c8a11bee8d50947d467f06ee1c0755fe7a72 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()
@@ -68,7 +77,7 @@ class PluginDownloadBrowser(Screen):
                self.container.appClosed.get().append(self.runFinished)
                self.container.dataAvail.get().append(self.dataAvail)
                self.onLayoutFinish.append(self.startRun)
-               self.onShown.append(self.setTitle)
+               self.onShown.append(self.setWindowTitle)
                
                self.list = []
                self["list"] = PluginList(self.list)
@@ -104,15 +113,15 @@ class PluginDownloadBrowser(Screen):
        def runInstall(self, val):
                if val:
                        if self.type == self.DOWNLOAD:
-                               self.session.openWithCallback(self.installFinished, Console, ["ipkg install " + "enigma2-plugin-" + self["list"].l.getCurrentSelection()[0].name])
+                               self.session.openWithCallback(self.installFinished, Console, cmdlist = ["ipkg install " + "enigma2-plugin-" + self["list"].l.getCurrentSelection()[0].name])
                        elif self.type == self.REMOVE:
-                               self.session.openWithCallback(self.installFinished, Console, ["ipkg remove " + "enigma2-plugin-" + self["list"].l.getCurrentSelection()[0].name])
+                               self.session.openWithCallback(self.installFinished, Console, cmdlist = ["ipkg remove " + "enigma2-plugin-" + self["list"].l.getCurrentSelection()[0].name])
 
-       def setTitle(self):
+       def setWindowTitle(self):
                if self.type == self.DOWNLOAD:
-                       self.session.currentDialog.instance.setTitle(_("Downloadable new plugins"))
+                       self.setTitle(_("Downloadable new plugins"))
                elif self.type == self.REMOVE:
-                       self.session.currentDialog.instance.setTitle(_("Remove plugins"))
+                       self.setTitle(_("Remove plugins"))
 
        def startRun(self):
                self["list"].instance.hide()