The function changeDirectory has been added, to also change directory from "outside...
authorVolker Christian <voc@users.schwerkraft.elitedvb.net>
Sun, 15 Jun 2008 16:30:16 +0000 (16:30 +0000)
committerVolker Christian <voc@users.schwerkraft.elitedvb.net>
Sun, 15 Jun 2008 16:30:16 +0000 (16:30 +0000)
vlcplayer/src/VlcFileList.py

index e8b9882..87e69b4 100755 (executable)
@@ -99,27 +99,31 @@ class VlcFileList(MenuList):
                                return True
                return False
 
-       def activate(self):
-               if self.getCurrent() is not None:
-                       if self.getCurrent()[0][1]:
-                               previousDirectory = self.currentDirectory
-                               self.currentDirectory = self.getCurrent()[0][0]
-                               try:
-                                       if self.update():
-                                               if self.isVideoTS():
-                                                       ret = "dvdsimple://" + self.currentDirectory + "/VIDEO_TS", self.currentDirectory
-                                                       self.currentDirectory = previousDirectory
-                                                       self.update()
-                                               else:
-                                                       ret = None, self.currentDirectory
-                                       else:
-                                               self.currentDirectory = previousDirectory
-                                               ret = None, None
-                               except ExpatError, e:
+       def changeDirectory(self, directory):
+               previousDirectory = self.currentDirectory
+               self.currentDirectory = directory
+               try:
+                       if self.update():
+                               if self.isVideoTS():
+                                       ret = "dvdsimple://" + self.currentDirectory + "/VIDEO_TS", self.currentDirectory
                                        self.currentDirectory = previousDirectory
                                        self.update()
+                               else:
                                        ret = None, self.currentDirectory
                        else:
+                               self.currentDirectory = previousDirectory
+                               ret = None, None
+               except ExpatError, e:
+                       self.currentDirectory = previousDirectory
+                       self.update()
+                       ret = None, self.currentDirectory
+               return ret
+
+       def activate(self):
+               if self.getCurrent() is not None:
+                       if self.getCurrent()[0][1]:
+                               ret = self.changeDirectory(self.getCurrent()[0][0])
+                       else:
                                ret = self.getCurrent()[0][0], self.getCurrent()[1][7]
                else:
                        ret = None, None