aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/test/plugin.py
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-02-21 18:50:23 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-02-21 18:50:23 +0000
commitf458abcfbe30c3e3062a41b88d3244147bdc0607 (patch)
tree43b878a27855eccecc1cf3f35820a234afcc375a /lib/python/Plugins/test/plugin.py
parent7319cb85c7a9a6304ac92a7854a5d79c9d9f115b (diff)
downloadenigma2-f458abcfbe30c3e3062a41b88d3244147bdc0607.tar.gz
enigma2-f458abcfbe30c3e3062a41b88d3244147bdc0607.zip
add FileList component for browsing files and directories
Diffstat (limited to 'lib/python/Plugins/test/plugin.py')
-rw-r--r--lib/python/Plugins/test/plugin.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/python/Plugins/test/plugin.py b/lib/python/Plugins/test/plugin.py
index 1500dd8d..0a375335 100644
--- a/lib/python/Plugins/test/plugin.py
+++ b/lib/python/Plugins/test/plugin.py
@@ -5,6 +5,7 @@ from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.Input import Input
from Components.GUIComponent import *
+from Components.FileList import FileEntryComponent, FileList
from Plugins.Plugin import PluginDescriptor
import os
@@ -12,21 +13,23 @@ import os
class Test(Screen):
skin = """
<screen position="100,100" size="550,400" title="Test" >
- <widget name="text" position="0,0" size="550,25" font="Regular;20" />
+ <!--widget name="text" position="0,0" size="550,25" font="Regular;20" /-->
+ <widget name="list" position="10,0" size="190,250" scrollbarMode="showOnDemand" />
</screen>"""
-
def __init__(self, session, args = None):
self.skin = Test.skin
Screen.__init__(self, session)
- self["text"] = Input("1234", maxSize=True, type=Input.NUMBER)
+ self["list"] = FileList("/")
+
+ #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,
@@ -45,6 +48,11 @@ 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])
+
def keyNumberGlobal(self, number):
print "pressed", number
self["text"].number(number)