from Components.ActionMap import ActionMap, NumberActionMap, HelpableActionMap
from Components.Label import Label
from Components.FileList import FileList
-from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from Components.config import config
from Components.ProgressBar import ProgressBar
from ServiceReference import ServiceReference
import random
import servicedvd # load c++ part of dvd player plugin
+lastpath = ""
+
class FileBrowser(Screen):
skin = """
<screen name="FileBrowser" position="100,100" size="520,376" title="DVD File Browser" >
</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:
})
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)
self.Timer.callback.append(self.keyOK)
self.Timer.start(3000, True)
-class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen):
+class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen):
ALLOW_SUSPEND = True
ENABLE_RESUME_SUPPORT = True
def __init__(self, session, args = None):
Screen.__init__(self, session)
+ InfoBarBase.__init__(self)
InfoBarNotifications.__init__(self)
InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
InfoBarShowHide.__init__(self)
def keyOk(self):
if self.service:
+ if not self.in_menu:
+ self.toggleInfo()
self.service.keys().keyPressed(iServiceKeys.keyOk)
def keyCancel(self):