the missing plugin
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 22 Feb 2006 22:27:44 +0000 (22:27 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 22 Feb 2006 22:27:44 +0000 (22:27 +0000)
lib/python/Plugins/Extensions/FileManager/Makefile.am [new file with mode: 0644]
lib/python/Plugins/Extensions/FileManager/__init__.py [new file with mode: 0644]
lib/python/Plugins/Extensions/FileManager/plugin.py [new file with mode: 0644]

diff --git a/lib/python/Plugins/Extensions/FileManager/Makefile.am b/lib/python/Plugins/Extensions/FileManager/Makefile.am
new file mode 100644 (file)
index 0000000..bf4828d
--- /dev/null
@@ -0,0 +1,6 @@
+installdir = $(LIBDIR)/enigma2/python/Plugins/FileManager
+
+install_PYTHON =       \
+       __init__.py \
+       plugin.py
diff --git a/lib/python/Plugins/Extensions/FileManager/__init__.py b/lib/python/Plugins/Extensions/FileManager/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/python/Plugins/Extensions/FileManager/plugin.py b/lib/python/Plugins/Extensions/FileManager/plugin.py
new file mode 100644 (file)
index 0000000..b733645
--- /dev/null
@@ -0,0 +1,69 @@
+from enigma import *
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+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 FileManager(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="list" position="10,0" size="190,250" scrollbarMode="showOnDemand" />
+                       <widget name="pixmap" position="200,0" size="190,250" />
+               </screen>"""
+       def __init__(self, session, args = None):
+               self.skin = FileManager.skin
+               Screen.__init__(self, session)
+
+               self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)")
+               self["pixmap"] = Pixmap()
+               
+               #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER)
+                               
+               self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
+               {
+                       "ok": self.ok,
+                       "back": self.close,
+#                      "left": self.keyLeft,
+#                      "right": self.keyRight,
+                       "1": self.keyNumberGlobal,
+                       "2": self.keyNumberGlobal,
+                       "3": self.keyNumberGlobal,
+                       "4": self.keyNumberGlobal,
+                       "5": self.keyNumberGlobal,
+                       "6": self.keyNumberGlobal,
+                       "7": self.keyNumberGlobal,
+                       "8": self.keyNumberGlobal,
+                       "9": self.keyNumberGlobal,
+                       "0": self.keyNumberGlobal
+               }, -1)
+               
+       def keyLeft(self):
+               self["text"].left()
+       
+       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 main(session):
+       session.open(FileManager)
+
+def Plugins():
+       return PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)