X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/aa4989974a32ab2437d51fb6352b3eb54cecd83d..287f7c2cfaf264b079cce1bf789d118ee444180f:/lib/python/Plugins/Extensions/FileManager/plugin.py diff --git a/lib/python/Plugins/Extensions/FileManager/plugin.py b/lib/python/Plugins/Extensions/FileManager/plugin.py index a17e631c..62c9e7b2 100644 --- a/lib/python/Plugins/Extensions/FileManager/plugin.py +++ b/lib/python/Plugins/Extensions/FileManager/plugin.py @@ -1,16 +1,9 @@ -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 Components.FileList import FileList from Plugins.Plugin import PluginDescriptor -import os - class FileManager(Screen): skin = """ @@ -22,7 +15,7 @@ class FileManager(Screen): self.skin = FileManager.skin Screen.__init__(self, session) - self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)") + self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)", useServiceRef = True) self["pixmap"] = Pixmap() #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER) @@ -52,11 +45,11 @@ class FileManager(Screen): self["text"].right() def ok(self): - selection = self["list"].getSelection() - if selection[1] == True: # isDir - self["list"].changeDir(selection[0]) + + if self["list"].canDescent(): # isDir + self["list"].descent() else: - self["pixmap"].instance.setPixmapFromFile(selection[0]) + self["pixmap"].instance.setPixmapFromFile(self["list"].getFilename()) def keyNumberGlobal(self, number): print "pressed", number @@ -66,4 +59,6 @@ def main(session, **kwargs): session.open(FileManager) def Plugins(**kwargs): - return PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main) + descr = _("Lets you view/edit files in your Dreambox") + return [PluginDescriptor(name="File-Manager", description=descr, where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main), + PluginDescriptor(name="File-Manager", description=descr, where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)]