diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-21 04:41:36 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-21 04:41:36 +0000 |
| commit | ccb8d260ed5e51f6f65205be04744a9e8322aa6f (patch) | |
| tree | c8243a30d7b7627229186ca13a463952b92c1322 /lib/python/Screens | |
| parent | 8589eb49ec20d3503a476f398ec84d7ad0307d26 (diff) | |
| download | enigma2-ccb8d260ed5e51f6f65205be04744a9e8322aa6f.tar.gz enigma2-ccb8d260ed5e51f6f65205be04744a9e8322aa6f.zip | |
add plugins
to test it: uncomment the example.py in lib/python/Plugins/Makefile.am
plugins can be added at runtime
Diffstat (limited to 'lib/python/Screens')
| -rw-r--r-- | lib/python/Screens/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Screens/PluginBrowser.py | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index 15b56d41..d191a5ba 100644 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -8,4 +8,4 @@ install_PYTHON = \ EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \ AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \ Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \ - TutorialWizard.py + TutorialWizard.py PluginBrowser.py diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py new file mode 100644 index 00000000..c03aa910 --- /dev/null +++ b/lib/python/Screens/PluginBrowser.py @@ -0,0 +1,46 @@ +from Screen import Screen + +from Components.MenuList import MenuList +from Components.ActionMap import ActionMap +from Components.PluginComponent import plugins +from Components.PluginList import * +from Components.config import config + + +class PluginBrowser(Screen): + def __init__(self, session): + Screen.__init__(self, session) + + self.list = [] + self["list"] = PluginList(self.list) + self.updateList() + + self["actions"] = ActionMap(["WizardActions"], + { + "ok": self.save, + "back": self.close, + "up": self.up, + "down": self.down + }, -1) + + def save(self): + #self.close() + self.run() + + def run(self): + plugin = self.pluginlist[self["list"].l.getCurrentSelectionIndex()] + plugins.runPlugin(plugin, self.session) + + def updateList(self): + self.list = [] + self.pluginlist = plugins.getPluginList() + for x in self.pluginlist: + self.list.append(PluginEntryComponent(x[0], x[1])) + + self["list"].l.setList(self.list) + + def up(self): + self["list"].instance.moveSelection(self["list"].instance.moveUp) + + def down(self): + self["list"].instance.moveSelection(self["list"].instance.moveDown) |
