from Screen import Screen
-from enigma import eConsoleAppContainer, loadPNG
+from enigma import eConsoleAppContainer
-from Components.MenuList import MenuList
from Components.ActionMap import ActionMap
from Components.PluginComponent import plugins
from Components.PluginList import *
-from Components.config import config
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, SCOPE_SKIN_IMAGE
+from Tools.LoadPixmap import LoadPixmap
+
class PluginBrowser(Screen):
def __init__(self, session):
})
def go(self):
- if type(self["list"].l.getCurrentSelection()[0]) is str: # category
- if self["list"].l.getCurrentSelection()[0] in self.expanded:
- self.expanded.remove(self["list"].l.getCurrentSelection()[0])
+ sel = self["list"].l.getCurrentSelection()
+
+ if sel is None:
+ return
+
+ if type(sel[0]) is str: # category
+ if sel[0] in self.expanded:
+ self.expanded.remove(sel[0])
else:
- self.expanded.append(self["list"].l.getCurrentSelection()[0])
+ self.expanded.append(sel[0])
self.updateList()
else:
if self.type == self.DOWNLOAD:
- self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to download\nthe plugin \"" + self["list"].l.getCurrentSelection()[0].name + "\"?"))
+ self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to download\nthe plugin \"" + sel[0].name + "\"?"))
elif self.type == self.REMOVE:
- self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to REMOVE\nthe plugin \"" + self["list"].l.getCurrentSelection()[0].name + "\"?"))
+ self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to REMOVE\nthe plugin \"" + sel[0].name + "\"?"))
def runInstall(self, val):
if val:
def updateList(self):
self.list = []
- expandableIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "expandable-plugins.png"))
- expandedIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "expanded-plugins.png"))
- verticallineIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "verticalline-plugins.png"))
+ expandableIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "expandable-plugins.png"))
+ expandedIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "expanded-plugins.png"))
+ verticallineIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "verticalline-plugins.png"))
self.plugins = {}
for x in self.pluginlist: