X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2Ftest%2Fplugin.py;h=18e81885f10f2880da3f2a19d7e6c37fcf849a30;hp=c08a986f4d70f680e77f13270e5818707e843f14;hb=105064cb459d5027ab5cfacb20f31ab04569ace2;hpb=85f5c84f1e3e4d22fb1939751d39de03877b93d8 diff --git a/lib/python/Plugins/test/plugin.py b/lib/python/Plugins/test/plugin.py index c08a986..18e8188 100644 --- a/lib/python/Plugins/test/plugin.py +++ b/lib/python/Plugins/test/plugin.py @@ -5,27 +5,34 @@ from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.Input import Input from Components.GUIComponent import * +from Components.Pixmap import Pixmap +from Components.FileList import FileEntryComponent, FileList +from Plugins.Plugin import PluginDescriptor import os class Test(Screen): skin = """ - + + + """ - def __init__(self, session, args = None): self.skin = Test.skin Screen.__init__(self, session) - self["text"] = Input("Please press OK!") + self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3)") + self["pixmap"] = Pixmap() + + #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER) - self["actions"] = NumberActionMap(["WizardActions", "InputActions"], + self["actions"] = NumberActionMap(["WizardActions", "InputActions"], { - "ok": self.close, + "ok": self.ok, "back": self.close, - "left": self.keyLeft, - "right": self.keyRight, +# "left": self.keyLeft, +# "right": self.keyRight, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, @@ -44,12 +51,19 @@ class Test(Screen): def keyRight(self): self["text"].right() + def ok(self): + selection = self["list"].getSelection() + if selection[1] == True: # isDir + self["list"].changeDir(selection[0]) + else: + self["pixmap"].instance.setPixmapFromFile(selection[0]) + def keyNumberGlobal(self, number): print "pressed", number self["text"].number(number) -def getPicturePaths(): - return [ "" ] +def main(session): + session.open(Test) -def getPlugins(): - return [("Test", "plugin to test some capabilities", "screen", "Test")] +def Plugins(): + return PluginDescriptor(name="Test", description="plugin to test some capabilities", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)