plugins can appear in the extensions menu now
[enigma2.git] / lib / python / Plugins / Extensions / FileManager / plugin.py
index a17e631ce59e611fae0a2096aff6f522cebead8b..d2b197193baa5d0a54856b3b216c7e9180ed3d2a 100644 (file)
@@ -22,7 +22,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 +52,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 +66,5 @@ 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)
+       return [PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main),
+                       PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)]