From 0d1f59e4a4c6b096b18cac11876066e3384c4b3a Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Wed, 16 Apr 2008 20:11:25 +0000 Subject: [PATCH] Infobar toggleable with OK key and remember last file browser directory --- .../Plugins/Extensions/DVDPlayer/plugin.py | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index bab64ce1..3ecd9f8a 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -19,6 +19,8 @@ from Tools.Directories import pathExists, fileExists import random import servicedvd # load c++ part of dvd player plugin +lastpath = "" + class FileBrowser(Screen): skin = """ @@ -26,7 +28,11 @@ class FileBrowser(Screen): """ def __init__(self, session): Screen.__init__(self, session) - currDir = "/media/dvd/" + global lastpath + if lastpath is not None: + currDir = lastpath + "/" + else: + currDir = "/media/dvd/" if not pathExists(currDir): currDir = "/" #else: @@ -41,15 +47,18 @@ class FileBrowser(Screen): }) def ok(self): + global lastpath filename = self["filelist"].getFilename() - if filename is not None and filename.upper().endswith("VIDEO_TS/"): - print "dvd structure found, trying to open..." - self.close(filename[0:-9]) - elif self["filelist"].canDescent(): # isDir + if filename is not None: + lastpath = filename[0:filename.rfind("/")] + if filename.upper().endswith("VIDEO_TS/"): + print "dvd structure found, trying to open..." + self.close(filename[0:-9]) + if self["filelist"].canDescent(): # isDir self["filelist"].descent() else: self.close(filename) - + def exit(self): self.close(None) @@ -474,6 +483,8 @@ class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSuppor def keyOk(self): if self.service: + if not self.in_menu: + self.toggleInfo() self.service.keys().keyPressed(iServiceKeys.keyOk) def keyCancel(self): -- 2.30.2